bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib update (Tue Sep 13 09:03:01 EDT 2005)


From: Jim Meyering
Subject: Re: gnulib update (Tue Sep 13 09:03:01 EDT 2005)
Date: Tue, 13 Sep 2005 21:43:52 +0200

Derek Price <address@hidden> wrote:
> Jim Meyering wrote:
>>Personally, I've found it useful enough to have consistently cpp-indented
>
> I like it too, but I was willing to go with the flow on GNULIB.  :)
>
>>sources that I wrote cppi, and to use it in a commit-hook for the coreutils.
>
> I don't know when it became an option, but `indent -ppi 1' implements
> the consistent style you described, I believe.  Does cppi do something
> different?

They probably produce similar output.
When I wrote cppi, indent didn't have that option.
I wrote cppi because I needed something fast enough so that commits
affecting many large files wouldn't suffer a noticeable slow-down due
to this hook.

I've just uploaded these:

  ftp://ftp.gnu.org/gnu/coreutils/cppi-1.12.tar.gz
  ftp://ftp.gnu.org/gnu/coreutils/cppi-1.12.tar.bz2

Here's the --help output from cppi:

Usage: cppi [FILE]
  or:  cppi -c [OPTION] [FILE]...

Indent the C preprocessor directives in FILE to reflect their nesting
and ensure that there is exactly one space character between each #if,
#elif, #define directive and the following token, and write the result
to standard output.  The number of spaces between the `#' and the following
directive must correspond to the level of nesting of that directive.
With no FILE, or when FILE is -, read standard input.

  -a, --ansi             when checking, fail if text follows #else or #endif
  -c, --check            set exit code, but don't produce any output
  -l, --list-files-only  don't generate diagnostics about indentation;
                           print to stdout only the names of files that
                           are not properly indented
  -m, --max-string-length=LENGTH
                         fail if there is a double-quoted string longer
                           than LENGTH;  if LENGTH is 0 (the default),
                           then there is no limit
      --help             print this help, then exit
      --version          print version information, then exit

With the -c option, don't write to stdout.  Instead, check the
indentation of the specified files giving diagnostics for preprocessor
lines that aren't properly indented or are otherwise invalid.

Note that --ansi without --check does not correct the problem of
non-ANSI text following #else and #endif directives.

The exit code will be one of these:
  0 all directives properly indented
  1 some cpp directive(s) improperly indented
  1 if text follows #else/#endif (enabled with --check --ansi)
  2 #if/#endif mismatch
  3 file (e.g. read/write) error
  4 found a double-quoted string longer than the specified maximum

A pragma directive may have its `#' indented.

Report bugs to <address@hidden>.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]