indent
reformats C source code according to specified style guidelines
TLDR
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.-npro
Do not read .indent.pro profile files.-bad
Force blank line after declarations.-bap
Force blank line after procedure bodies.-nbc
Do not force newlines after commas in declarations.--help
Display help information.
CAVEATS
C-specific; does not handle C++ or other languages well. May alter semantics when processing complex macros or preprocessor directives. Modifies files in-place by default; use -o to write to a separate file. Configuration can be stored in .indent.pro files loaded automatically from the current directory or home directory.
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)
