📄 indent.1
字号:
The `-pcs' option causes a space to be placed between the name ofthe 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 castoperator.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..SH "DECLARATIONS"By default `indent' will line up identifiers, in the columnspecified by the `-di' option. For example, `-di16' makes things looklike:.in +5.nf.na int foo; char *bar;.in -5.ad.fiUsing a small value (such as one or two) for the `-di' option can beused to cause the indentifiers to be placed in the first availableposition, for example.in +5.nf.na int foo; char *bar;.in -5.ad.fiThe value given to the `-di' option will still affect variableswhich are put on separate lines from their types, for example `-di2'will lead to.in +5.nf.na int foo;.in -5.ad.fiIf the `-bc' option is specified, a newline is forced after eachcomma in a declaration. For example,.in +5.nf.na int a, b, c;.in -5.ad.fiWith the `-nbc' option this would look like.in +5.nf.na int a, b, c;.in -5.ad.fiThe `-psl' option causes the type of a procedure being defined to beplaced on the line before the name of the procedure. This style isrequired for the `etags' program to work correctly, as well as some ofthe `c-mode' functions of Emacs.If you are not using the `-di1' option to place variables beingdeclared immediately after their type, you need to use the `-T' optionto tell `indent' the name of all the typenames in your program that aredefined by `typedef'. `-T' can be specified more than once, and allnames specified are used. For example, if your program contains.in +5.nf.na typedef unsigned long CODE_ADDR; typedef enum {red, blue, green} COLOR;.in -5.ad.fiyou would use the options `-T CODE_ADDR -T COLOR'..SH "INDENTATION"One issue in the formatting of code is how far each line should beindented from the left margin. When the beginning of a statement suchas `if' or `for' is encountered, the indentation level is increased bythe value specified by the `-i' option. For example, use `-i8' tospecify an eight character indentation for each level. When a statementis continued from a previous line, it is indented by a number ofadditional spaces specified by the `-ci' option. `-ci' defaults to 0. However, if the `-lp' option is specified, and a line has a leftparenthesis which is not closed on that line, then continuation lineswill be lined up to start at the character position just after the leftparenthesis. This processing also applies to `[' and applies to `{'when it occurs in initialization lists. For example, a piece ofcontinued code might look like this with `-nlp -ci3' in effect:.in +5.nf.na p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5));.in -5.ad.fiWith `-lp' in effect the code looks somewhat clearer:.in +5.nf.na p1 = first_procedure (second_procedure (p2, p3), third_procedure (p4, p5));.in -5.ad.fi`indent' assumes that tabs are placed at regular intervals of bothinput and output character streams. These intervals are by default 8columns wide, but (as of version 1.2) may be changed by the `-ts'option. Tabs are treated as the equivalent number of spaces.The indentation of type declarations in old-style functiondefinitions is controlled by the `-ip' parameter. This is a numericparameter specifying how many spaces to indent type declarations. Forexample, the default `-ip5' makes definitions look like this:.in +5.nf.na char * create_world (x, y, scale) int x; int y; float scale; { . . . }.in -5.ad.fiFor compatibility with other versions of indent, the option `-nip'is provided, which is equivalent to `-ip0'..SH "MISCELLANEOUS OPTIONS"To find out what version of `indent' you have, use the command`indent -version'. This will report the version number of `indent',without doing any of the normal processing.The `-v' option can be used to turn on verbose mode. When inverbose mode, `indent' reports when it splits one line of input intotwo more more lines of output, and gives some size statistics atcompletion..SH "COPYRIGHT"The following copyright notice applies to the `indent' program. Thecopyright and copying permissions for this manual appear near thebeginning of this document..nf.na Copyright (c) 1989, 1992 Free Software Foundation Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents of the University of California. Copyright (c) 1976 Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley, the University of Illinois, Urbana, and Sun Microsystems, Inc. The name of either University or Sun Microsystems may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE..ad.fi.SH OPTIONSHere is a list of all the options for `indent', alphabetized byshort option. It is followed by a cross key alphabetized by longoption..nf.na`-bad'`--blank-lines-after-declarations' Force blank lines after the declarations.`-bap'`--blank-lines-after-procedures' Force blank lines after procedure bodies.`-bbb'`--blank-lines-after-block-comments' Force blank lines after block comments.`-bc'`--blank-lines-after-commas' Force newline after comma in declaration.`-bl'`--braces-after-if-line' Put braces on line after `if', etc.`-bliN'`--brace-indentN' Indent braces N spaces.`-br'`--braces-on-if-line' Put braces on line with `if', etc.`-cN'`--comment-indentationN' Put comments to the right of code in column N.`-cdN'`--declaration-comment-columnN' Put comments to the right of the declarations in column N.`-cdb'`--comment-delimiters-on-blank-lines' Put comment delimiters on blank lines.`-ce'`--cuddle-else' Cuddle else and preceeding `}'.`-ciN'`--continuation-indentationN' Continuation indent of N spaces.`-cliN'`--case-indentationN' Case label indent of N spaces.`-cpN'`--else-endif-columnN' Put comments to the right of `#else' and `#endif' statements in column N.`-cs'`--space-after-cast' Put a space after a cast operator.`-bs'`--blank-before-sizeof' Put a space between `sizeof' and its argument.`-dN'`--line-comments-indentationN' Set indentation of comments not to the right of code to N spaces.`-diN'`--declaration-indentationN' Put variables in column N.`-fc1'`--format-first-column-comments' Format comments in the first column.`-fca'`--format-all-comments' Do not disable all formatting of comments.`-gnu'`--gnu-style' Use GNU coding style. This is the default.`-iN'`--indent-levelN' Set indentation level to N spaces.`-ipN'`--parameter-indentationN' Indent parameter types in old-style function definitions by N spaces.`-kr'`--k-and-r-style' Use Kernighan & Ritchie coding style.`-lN'`--line-lengthN' Set maximum line length to N.`-lp'`--continue-at-parentheses' Line up continued lines at parentheses.`-nbad'`--no-blank-lines-after-declarations' Do not force blank lines after declarations.`-nbap'`--no-blank-lines-after-procedures' Do not force blank lines after procedure bodies.`-nbbb'`--no-blank-lines-after-block-comments' Do not force blank-lines after block comments.`-nbc'`--no-blank-lines-after-commas' Do not force newlines after commas in declarations.`-ncdb'`--no-comment-delimiters-on-blank-lines' Do not put comment delimiters on blank lines.`-nce'`--dont-cuddle-else' Do not cuddle `}' and `else'.`-ncs'`--no-space-after-casts' Do not put a space after cast operators.`-nfc1'`--dont-format-first-column-comments' Do not format comments in the first column as normal.`-nfca'`--dont-format-comments' Do not format any comments.`-nip'`--no-parameter-indentation' Zero width indentation for parameters.`-nlp'`--dont-line-up-parentheses' Do not line up parentheses.`-npcs'`--no-space-after-function-call-names' Do not put space after the function in function calls.`-npsl'`--dont-break-procedure-type' Put the type of a procedure on the same line as its name.`-nsc'`--dont-star-comments' Do not put the `*' character at the left of comments.`-nsob'`--leave-optional-blank-lines' Do not swallow optional blank lines.`-nss'`--dont-space-special-semicolon' Do not force a space before the semicolon after certain statements. Disables `-ss'.`-nv'`--no-verbosity'`-orig'`--original' Use the original Berkeley coding style.`-npro'`--ignore-profile' Do not read `.indent.pro' files.`-pcs'`--space-after-procedure-calls' Insert a space between the name of the procedure being called and the `('.`-psl'`--procnames-start-lines' Put the type of a procedure on the line before its name.`-sc'`--start-left-side-of-comments' Put the `*' character at the left of comments.`-sob'`--swallow-optional-blank-lines' Swallow optional blank lines.`-ss'`--space-special-semicolon' On one-line `for' and `while' statments, force a blank before the semicolon.`-st'`--standard-output' Write to standard output.`-T' Tell `indent' the name of typenames.`-tsN'`--tab-sizeN' Set tab size to N spaces.`-v'`--verbose' Enable verbose mode.`-version' Output the version number of `indent'..ad.fi.SH "OPTIONS CROSS-REFERENCE"Here is a list of options alphabetized by long option, to help youfind the corresponding short option..in +5.nf.na --blank-lines-after-block-comments -bbb --blank-lines-after-commas -bc --blank-lines-after-declarations -bad --blank-lines-after-procedures -bap --braces-after-if-line -bl --brace-indent -bli --braces-on-if-line -br --case-indentation -cliN --comment-delimiters-on-blank-lines -cdb --comment-indentation -cN --continuation-indentation -ciN --continue-at-parentheses -lp --cuddle-else -ce --declaration-comment-column -cdN --declaration-indentation -diN --dont-break-procedure-type -npsl --dont-cuddle-else -nce --dont-format-comments -nfca --dont-format-first-column-comments -nfc1 --dont-line-up-parentheses -nlp --dont-space-special-semicolon -nss --dont-star-comments -nsc --else-endif-column -cpN --format-all-comments -fca --format-first-column-comments -fc1 --gnu-style -gnu --ignore-profile -npro --indent-level -iN --k-and-r-style -kr --leave-optional-blank-lines -nsob --line-comments-indentation -dN --line-length -lN --no-blank-lines-after-block-comments -nbbb --no-blank-lines-after-commas -nbc --no-blank-lines-after-declarations -nbad --no-blank-lines-after-procedures -nbap --no-comment-delimiters-on-blank-lines -ncdb --no-space-after-casts -ncs --no-parameter-indentation -nip --no-space-after-function-call-names -npcs --no-verbosity -nv --original -orig --parameter-indentation -ipN --procnames-start-lines -psl --space-after-cast -cs --space-after-procedure-calls -pcs --space-special-semicolon -ss --standard-output -st --start-left-side-of-comments -sc --swallow-optional-blank-lines -sob --tab-size -tsN --verbose -v.in -5.ad.fi.SH "RETURN VALUE"Unknown.SH FILES.br.nf.\" set tabstop to longest possible filename, plus a wee bit.ta \w'/usr/lib/perl/getopts.pl 'u\fI$HOME/.indent.pro\fR holds default options for indent..SH AUTHORThe Free Software Foundation..SH HISTORYDerived from the UCB program "indent".
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -