| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 ‘-bbb’ option forces a blank line before every boxed comment (See section Comments.) The ‘-nbbb’ option does not force such blank lines.
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.
| 1.4.1 –blank-lines-after-declarations | More on the ‘-bad’ option. | |
| 1.4.2 –blank-lines-after-procedures | More on the ‘-bap’ option. |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The ‘-bad’ option forces a blank line after every block of declarations. The ‘-nbad’ option does not add any such blank lines.
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; |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by david on December, 15 2008 using texi2html 1.78.