Go to the first, previous, next, last section, table of contents.


Statements

The `-br' or `-bl' option specifies how to format braces.

The `-br' option formats statement braces like this:

if (x > 0) {
  x--;
}

The `-bl' option formats them like this:

if (x > 0)
  {
    x--;
  }

These options also affect structure and enumeration declarations. The `-br' option produces structure declarations like the following:

struct Sname {
    int i;
    char chp;
} Vname;

The default behaviour, also obtained by specifying `-bl', would yield the following format for the same declaration:

struct Sname
  {
     int i;
     char chp;
  }
Vname;

If you use the `-bl' option, you may also want to specify the `-bli' option. This option specifies the number of spaces by which braces are indented. `-bli2', the default, gives the result shown above. `-bli0' results in the following:

if (x > 0)
{
  x--;
}

If you are using the `-br' option, you probably want to also use the `-ce' option. This causes the else in an if-then-else construct to cuddle up to the immediately preceding `}'. For example, with `-br -ce' you get the following:

if (x > 0) {
  x--;
} else {
  fprintf (stderr, "...something wrong?\n");
}

With `-br -nce' that code would appear as

if (x > 0) {
  x--;
}
else {
  fprintf (stderr, "...something wrong?\n");
}

The `-cli' option specifies the number of spaces that case labels should be indented to the right of the containing `switch' statement.

If a semicolon is on the same line as a for or while statement, the `-ss' option will cause a space to be placed before the semicolon. This emphasizes the semicolon, making it clear that the body of the for or while statement is an empty statement. -nss disables this feature.

The `-pcs' option causes a space to be placed between the name of the procedure being called and the `(' (for example, puts ("Hi");. The `-npcs' option would give puts("Hi");).

If the `-cs' option is specified, indent puts a space after a cast operator.

The `-bs' option ensures that there is a space between the keyword sizeof and its argument. In some versions, this is known as the `Bill_Shannon' option.


Go to the first, previous, next, last section, table of contents.