Indent (Unix)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Lowercase Template:Refimprove {{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other

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>{{#invoke:citation/CS1|citation |CitationClass=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>{{#invoke:citation/CS1|citation |CitationClass=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>{{#invoke:citation/CS1|citation |CitationClass=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

Template:Reflist

Template:GNU


Template:Unix-stub

de:Astyle