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


Blank lines

Various programming styles use blank lines in different places. indent has a number of options to insert or delete blank lines in specific places.

The `-bad' option causes indent to force a blank line after every block of declarations. The `-nbad' option causes indent not to force such blank lines.

The `-bap' option forces a blank line after every procedure body. The `-nbap' option forces no such blank line.

The `-sob' option causes indent to swallow optional blank lines (that is, any optional blank lines present in the input will be removed from the output). If the `-nsob' is specified, any blank lines present in the input file will be copied to the output file.

For example, given the input

char *foo;
char *bar;
/* This separates blocks of declarations.  */
int baz;

indent -bad produces

char *foo;
char *bar;

/* This separates blocks of declarations.  */
int baz;

and indent -nbad produces

char *foo;
char *bar;
/* This separates blocks of declarations.  */
int baz;

The `-bap' option forces a blank line after every procedure body.

For example, given the input

int
foo ()
{
  puts("Hi");
}
/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts("Hello");
}

indent -bap produces

int
foo ()
{
  puts ("Hi");
}

/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts ("Hello");
}

and indent -nbap produces

int
foo ()
{
  puts ("Hi");
}
/* The procedure bar is even less interesting.  */
char *
bar ()
{
  puts ("Hello");
}

No blank line will be added after the procedure foo.


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