indent 命令学习
-- 原来用过的一个命令,今天忘了, 只记得是什么功能,今天想用了,找了半天才找到,于是决定把这些都记下来。
============================================
INDENT(1L) INDENT(1L)
NAME
indent - changes the appearance of a C program by inserting or deleting
whitespace.
- 通过插入或删除空格改变 c 语言程序的外观。< 很好用的一个工具 >
SYNOPSIS
indent [options] [input-files]
indent [options] [single-input-file] [-o output-file]
indent --version
DESCRIPTION
This man page is generated from the file indent.texinfo. This is Edition
of "The indent Manual", for Indent Version , last updated .
indent程序可以使程序代码更易于阅读, 它还可以使C程序代码从一种风格转换到另一种风格。<接 下来的一段的翻译>
The indent program can be used to make code easier to read. It can also
convert from one style of writing C to another.
indent understands a substantial amount about the syntax of C, but it also
attempts to cope with incomplete and misformed syntax.
In version 1.2 and more recent versions, the GNU style of indenting is the
default.
OPTIONS
-bad, --blank-lines-after-declarations
Force blank lines after the declarations.
See BLANK LINES.
-bap, --blank-lines-after-procedures
Force blank lines after procedure bodies.
See BLANK LINES.
-bbb, --blank-lines-before-block-comments
Force blank lines before block comments.
See BLANK LINES.
-bbo, --break-before-boolean-operator
Prefer to break long lines before boolean operators.
See BREAKING LONG LINES.
-bc, --blank-lines-after-commas
Force newline after comma in declaration.
See DECLARATIONS.
-bl, --braces-after-if-line
Put braces on line after if, etc.
See STATEMENTS.
-blin, --brace-indentn
Indent braces n spaces.
See STATEMENTS.
-bls, --braces-after-struct-decl-line
Put braces on the line after struct declaration lines.
See DECLARATIONS.
-br, --braces-on-if-line
Put braces on line with if, etc.
See STATEMENTS.
-brs, --braces-on-struct-decl-line
Put braces on struct declaration line.
See DECLARATIONS.
-bs, --Bill-Shannon, --blank-before-sizeof
Put a space between sizeof and its argument.
See STATEMENTS.
-cn, --comment-indentationn
Put comments to the right of code in column n.
See COMMENTS.
-cbin, --case-brace-indentationn
Indent braces after a case label N spaces.
See STATEMENTS.
-cdn, --declaration-comment-columnn
Put comments to the right of the declarations in column n.
See COMMENTS.
-cdb, --comment-delimiters-on-blank-lines
Put comment delimiters on blank lines.
See COMMENTS.
-cdw, --cuddle-do-while
Cuddle while of do {} while; and preceeding `}´.
See COMMENTS.
-ce, --cuddle-else
Cuddle else and preceeding `}´.
See COMMENTS.
-cin, --continuation-indentationn
Continuation indent of n spaces.
See STATEMENTS.
-clin, --case-indentationn
Case label indent of n spaces.
See STATEMENTS.
-cpn, --else-endif-columnn
Put comments to the right of #else and #endif statements in column n.
See COMMENTS.
-cs, --space-after-cast
Put a space after a cast operator.
See STATEMENTS.
-dn, --line-comments-indentationn
Set indentation of comments not to the right of code to n spaces.
See COMMENTS.
-bfda, --break-function-decl-args
Break the line before all arguments in a declaration.
See DECLARATIONS.
-bfde, --break-function-decl-args
Break the line after the last argument in a declaration.
See DECLARATIONS.
-din, --declaration-indentationn
Put variables in column n.
See DECLARATIONS.
-fc1, --format-first-column-comments
Format comments in the first column.
See COMMENTS.
-fca, --format-all-comments
Do not disable all formatting of comments.
See COMMENTS.
-gnu, --gnu-style
Use GNU coding style. This is the default.
See COMMON STYLES.
-hnl, --honour-newlines
Prefer to break long lines at the position of newlines in the input.
See BREAKING LONG LINES.
-in, --indent-leveln
Set indentation level to n spaces.
See INDENTATION.
-ipn, --parameter-indentationn
Indent parameter types in old-style function definitions by n spaces.
See INDENTATION.
-kr, --k-and-r-style
Use Kernighan & Ritchie coding style.
See COMMON STYLES.
-ln, --line-lengthn
Set maximum line length for non-comment lines to n.
See BREAKING LONG LINES.
-lcn, --comment-line-lengthn
Set maximum line length for comment formatting to n.
See COMMENTS.
-lp, --continue-at-parentheses
Line up continued lines at parentheses.
See INDENTATION.
-lps, --leave-preprocessor-space
Leave space between `#´ and preprocessor directive.
See INDENTATION.
-nlps, --remove-preprocessor-space
Remove space between `#´ and preprocessor directive.
See INDENTATION.
-nbad, --no-blank-lines-after-declarations
Do not force blank lines after declarations.
See BLANK LINES.
-nbap, --no-blank-lines-after-procedures
Do not force blank lines after procedure bodies.
See BLANK LINES.
-nbbo, --break-after-boolean-operator
Do not prefer to break long lines before boolean operators.
See BREAKING LONG LINES.
-nbc, --no-blank-lines-after-commas
Do not force newlines after commas in declarations.
See DECLARATIONS.
-nbfda, --dont-break-function-decl-args
Don´t put each argument in a function declaration on a seperate line.
See DECLARATIONS.
-ncdb, --no-comment-delimiters-on-blank-lines
Do not put comment delimiters on blank lines.
See COMMENTS.
-ncdw, --dont-cuddle-do-while
Do not cuddle } and the while of a do {} while;.
See STATEMENTS.
-nce, --dont-cuddle-else
Do not cuddle } and else.
See STATEMENTS.
-ncs, --no-space-after-casts
Do not put a space after cast operators.
See STATEMENTS.
-nfc1, --dont-format-first-column-comments
Do not format comments in the first column as normal.
See COMMENTS.
-nfca, --dont-format-comments
Do not format any comments.
See COMMENTS.
-nhnl, --ignore-newlines
Do not prefer to break long lines at the position of newlines in the
input.
See BREAKING LONG LINES.
-nip, --no-parameter-indentation
Zero width indentation for parameters.
See INDENTATION.
-nlp, --dont-line-up-parentheses
Do not line up parentheses.
See STATEMENTS.
-npcs, --no-space-after-function-call-names
Do not put space after the function in function calls.
See STATEMENTS.
-nprs, --no-space-after-parentheses
Do not put a space after every ´(´ and before every ´)´.
。。。。