Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Indent (Unix)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{lowercase|title=indent}} {{refimprove|date=April 2014}} {{ infobox software | name = indent | logo = | caption = | author = David Willcox | released = {{Start date and age|1976|11}} | programming_language = [[C (programming language)|C]] | developer = David Ingamells, Carlo Wood, Joseph Arceneaux, Jim Kingdon, John Bridges | latest release version = {{wikidata|property|reference|P348}} | latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} | latest_preview_version = | latest_preview_date = | operating_system = [[Cross-platform]] | genre = source-code-reformat tool | license = GNU: [[GNU General Public License#Version 3|GPL-3.0-or-later]]<ref>{{cite web | author = GNU Savannah | title = GNU indent | url = https://savannah.gnu.org/projects/indent | quote = License: GNU General Public License v3 or later | access-date = 2023-10-30}}</ref> | website = GNU: {{URL|gnu.org/software/indent/}} }} '''indent''' is a [[Unix]] [[programming tool|utility]] that reformats [[C (programming language)|C]] and [[C++]] code in a user-defined [[indentation style]] and [[coding style]]. Support for C++ code is minimal.<ref>{{Cite web|url=http://www.gnu.org/software/indent/manual/indent.html#SEC15|title=indent: Indent and Format C Program Source|website=www.gnu.org|access-date=2019-08-16}}</ref> The original version of indent was written by David Willcox at the [[University of Illinois]] in November 1976. It was incorporated into [[BSD|4.1BSD]] in October 1982.<ref>{{cite web |url=https://invisible-island.net/cindent/cindent.html |title=CINDENT - C-language formatter |last=Dickey |first=Thomas |date=2017 |website=Invisible Island |access-date=2019-04-22}}</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 (computing)|native]] [[Windows API|Win32]] [[porting|ports]] of common GNU Unix-like utilities.<ref>{{Cite web|url=http://unxutils.sourceforge.net/|title=Native Win32 ports of some GNU utilities|website=unxutils.sourceforge.net}}</ref> ==Examples of usage== The following [[command (computing)|command]] <syntaxhighlight lang="sh"> $ indent -st -bap -bli0 -i4 -l79 -ncs -npcs -npsl -fca -lc79 -fc1 -ts4 some_file.c </syntaxhighlight> indents <code>some_file.c</code> in a style resembling [[Indent style#Allman style|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 [[Indentation style#GNU style|GNU style]], is used by default.<ref>[https://www.gnu.org/software/indent/manual/indent.pdf GNU Indent Manual]</ref> ==References== {{reflist}} ==External links== *[https://www.gnu.org/software/indent/ GNU indent Homepage] *{{man|1|indent|OpenBSD}} *[https://universalindent.sourceforge.net/ UniversalIndentGUI] *[http://clang.llvm.org/docs/ClangFormat.html clang-format] (an alternative to indent) {{GNU}} [[Category:GNU Project software]] [[Category:Unix programming tools]] {{Unix-stub}} [[de:Astyle]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:GNU
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase
(
edit
)
Template:Main other
(
edit
)
Template:Man
(
edit
)
Template:Refimprove
(
edit
)
Template:Reflist
(
edit
)
Template:Template other
(
edit
)
Template:Unix-stub
(
edit
)