Main index | Section 1 | 日本語 | Options |
NOTE: If you only specify an input-file, the formatting is done `in-place', that is, the formatted file is written back into input-file and a backup copy of input-file is written in the current directory. If input-file is named ' /blah/blah/file', the backup file is named ' file.BAK' by default. The extension used for the backup file may be overridden using the SIMPLE_BACKUP_SUFFIX environment variable.
If output-file is specified, indent checks to make sure that it is different from input-file.
The options listed below control the formatting style imposed by indent.
| |
If
| |
| |
If
| |
| |
This is vaguely similar to
| |
| |
If
| |
| |
If
| |
| |
If
| |
| |
Specifying
if (...) { code }
Specifying
if (...) { code } | |
| |
Whether a blank should always be inserted after sizeof.
The default is
| |
| |
The column in which comments on code start. The default is 33. | |
| |
The column in which comments on declarations start. The default is for these comments to start in the same column as those on code. | |
| |
Enables (disables) the placement of comment delimiters on blank lines.
With
this option enabled, comments look like this:
/* * this is a comment */ Rather than like this: /* this is a comment */
This only affects block comments, not comments to the right of
code.
The default is
| |
| |
Enables (disables) forcing of `else's to cuddle up to the immediately preceding
`}'.
The default is
| |
| |
Sets the continuation indent to be
n.
Continuation
lines will be indented that far from the beginning of the first line of the
statement.
Parenthesized expressions have extra indentation added to
indicate the nesting, unless
| |
| |
Causes case labels to be indented
n
tab stops to the right of the containing
switch
statement.
| |
| |
Control whether parenthesized type names in casts are followed by a space or
not.
The default is
| |
| |
Controls the placement of comments which are not to the
right of code.
For example,
| |
| |
Specifies the indentation, in character positions,
of global variable names and all struct/union member names
relative to the beginning of their type declaration.
The default is
| |
| |
| |
| |
Enables (disables) special
else-if
processing.
If it is enabled, an
if
following an
else
will have the same indentation as the preceding
amp;if
statement.
The default is
| |
| |
Enables (disables) extra indentation on continuation lines of
the expression part of
if
and
while
statements.
These continuation lines will be indented one extra level.
The default is
| |
| |
Enables (disables) splitting the function declaration and opening brace
across two lines.
The default is
| |
| |
Enables (disables) the formatting of comments that start in column 1.
Often, comments whose leading `/' is in column 1 have been carefully
hand formatted by the programmer.
In such cases,
| |
| |
Enables (disables) the formatting of block comments (ones that begin
with `/* ).
Often, block comments have been not so carefully hand formatted by the
programmer, but reformatting that would just change the line breaks is not
wanted.
In such cases,
| |
| |
The number of columns for one indentation level. The default is 8. | |
| |
Enables (disables) the indentation of parameter declarations from the left
margin.
The default is
| |
| |
Maximum length of an output line. The default is 78. | |
| |
Maximum length of an output line in a block comment.
The default is 0, which means to limit block comment lines in accordance with
| |
| |
Specifies the indentation, in character positions, of local variable names relative to the beginning of their type declaration. The default is for local variable names to be indented by the same amount as global ones. | |
| |
Lines up code surrounded by parentheses in continuation lines.
With
p1 = first_procedure(second_procedure(p2, p3), third_procedure(p4, p5));
With
p1 = first_procedure(second_procedure(p2, p3), third_procedure(p4, p5)); Inserting two more newlines we get: p1 = first_procedure(second_procedure(p2, p3), third_procedure(p4, p5)); | |
| |
With
| |
| |
Causes the profile files, ' ./.indent.pro' and ' ~/.indent.pro', to be ignored. | |
| |
Read profile from file. | |
| |
If true
( | |
| |
If true
( | |
| |
Enables (disables) the placement of asterisks (`*'s) at the left edge of all
comments.
The default is
| |
| |
If
| |
| |
Causes indent to take its input from stdin and put its output to stdout. | |
| |
Automatically add all identifiers ending in "_t" to the list of type keywords. | |
| |
Adds
typename
to the list of type keywords.
Names accumulate:
| |
| |
Assumed distance between tab stops. The default is 8. | |
| |
Adds type names from file to the list of type keywords. | |
| |
Enables (disables) the use of tab characters in the output.
The default is
| |
| |
| |
| |
Causes indent to print its version number and exit. | |
You may set up your own `profile' of defaults to indent by creating a file called .indent.pro in your login directory and/or the current directory and including whatever switches you like. A `.indent.pro' in the current directory takes precedence over the one in your login directory. If indent is run and a profile file exists, then it is read to set up the program's defaults. Switches on the command line, though, always override profile switches. The switches should be separated by spaces, tabs or newlines.
Straight text. All other comments are treated as straight text. The indent utility fits as many words (separated by blanks, tabs, or newlines) on a line as possible. Blank lines break paragraphs.
#define forever for(;;)
is handled properly.
./.indent.pro | |
profile file | |
~/.indent.pro | |
profile file | |
A common mistake is to try to indent all the C programs in a directory by typing:
indent *.c
This is probably a bug, not a feature.
INDENT (1) | June 11, 2018 |
Main index | Section 1 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | I define UNIX as “30 definitions of regular expressions living under one roof.” | ” |
— Donald Knuth |