Indent (Unix)
Template:Lowercase Template:Refimprove Template:Infobox software
indent is a Unix utility that reformats C and C++ code in a user-defined indentation style and coding style. Support for C++ code is minimal.<ref>Template:Cite web</ref>
The original version of indent was written by David Willcox at the University of Illinois in November 1976. It was incorporated into 4.1BSD in October 1982.<ref>Template:Cite web</ref> GNU indent was first written by Jim Kingdon in 1989. The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.<ref>Template:Cite web</ref>
Examples of usage
The following command
<syntaxhighlight lang="sh">
$ indent -st -bap -bli0 -i4 -l79 -ncs -npcs -npsl -fca -lc79 -fc1 -ts4 some_file.c
</syntaxhighlight>
indents some_file.c in a style resembling BSD/Allman style and writes the result to the standard output.
GNU indent
GNU indent is the GNU Project's version of indent. A different indentation style, the GNU style, is used by default.<ref>GNU Indent Manual</ref>
References
External links
- GNU indent Homepage
- Template:Man
- UniversalIndentGUI
- clang-format (an alternative to indent)