indent
reformats C source code according to specified style guidelines
TLDR
Format C source file
$ indent [source.c]
Format to specific style$ indent -kr [source.c]
GNU style formatting$ indent -gnu [source.c]
BSD style formatting$ indent -orig [source.c]
Output to different file$ indent [input.c] -o [output.c]
Set tab width$ indent -ts[4] [source.c]
SYNOPSIS
indent [options] file [output]
DESCRIPTION
indent reformats C source code according to specified style guidelines. It handles indentation, brace placement, spacing, and line breaking.
The tool supports predefined styles (K&R, GNU, BSD) and extensive customization. It can modify files in place or write to new files.
PARAMETERS
-kr
Kernighan & Ritchie style.-gnu
GNU coding style.-orig
Original BSD style.-linux
Linux kernel style.-ts N
Set tab size.-i N
Set indentation level.-l N
Maximum line length.-o FILE
Output file.--help
Display help information.
CAVEATS
C-specific. May alter semantics with macros. Backup before use.
HISTORY
indent originated in BSD Unix. The GNU version was developed as part of the GNU project with extended options.
SEE ALSO
clang-format(1), astyle(1), cb(1)
