CLANG-FORMAT(1)
π NAME π
okay so clang-format is the manual page for clang-format 11, and we're in the User Commands section of the manual, aka CLANG-FORMAT(1). bestie, this is the formatter page, periodt. π«Ά
β¨ DESCRIPTION β¨
π OVERVIEW π
OVERVIEW: it's giving a tool to format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code. no cap, it really does all those languages.
If no arguments are specified, it formats the code from standard input and writes the result to the standard output. If <file>s are given, it reformats the files. If -i is specified together with <file>s, the files are edited in-place. Otherwise, the result is written to the standard output. π
π«Ά USAGE π«Ά
USAGE:
clang-format [options] [<file> ...]
π OPTIONS π
π Clang-format options π
--Werrorβ If set, changes formatting warnings to errors. π--assume-filename=<string>β Override filename used to determine the language. When reading from stdin,clang-formatassumes this filename to determine the language. πΈ--cursor=<uint>β The position of the cursor when invokingclang-formatfrom an editor integration. π--dry-runβ If set, do not actually make the formatting changes. π--dump-configβ Dump configuration options to stdout and exit. Can be used with-styleoption. π--fallback-style=<string>β The name of the predefined style used as a fallback in caseclang-formatis invoked with-style=file, but can not find the.clang-formatfile to use. Use-fallback-style=noneto skip formatting. π¦--ferror-limit=<uint>β Set the maximum number ofclang-formaterrors to emit before stopping (0= no limit). Used only with--dry-runor-n. π₯-iβ Inplace edit<file>s, if specified. β¨--length=<uint>β Format a range of this length (in bytes). Multiple ranges can be formatted by specifying several-offsetand-lengthpairs. When only a single-offsetis specified without-length,clang-formatwill format up to the end of the file. Can only be used with one input file. π--lines=<string>β<start line>:<end line>β format a range of lines (both 1-based). Multiple ranges can be formatted by specifying several-linesarguments. Can't be used with-offsetand-length. Can only be used with one input file. π§-nβ Alias for--dry-run. π--offset=<uint>β Format a range starting at this byte offset. Multiple ranges can be formatted by specifying several-offsetand-lengthpairs. Can only be used with one input file. π--output-replacements-xmlβ Output replacements as XML. πΎ--sort-includesβ If set, overrides the include sorting behavior determined by theSortIncludesstyle flag. β--style=<string>β Coding style, currently supports:LLVM,GNU,Google,Chromium,Microsoft,Mozilla,WebKit.
Use -style=file to load style configuration from .clang-format file located in one of the parent directories of the source file (or current directory for stdin). Use -style="{key: value, ...}" to set specific parameters, e.g.:
-style="{BasedOnStyle: llvm, IndentWidth: 8}"
--verboseβ If set, shows the list of processed files. ποΈ
π Generic Options π
--helpβ Display available options (--help-hiddenfor more). π--help-listβ Display list of available options (--help-list-hiddenfor more). π--versionβ Display the version of this program. π·οΈ
okay bestie, that's the whole page π
β brought to you by clang-format 11, January 2022, and CLANG-FORMAT(1). bye, go format something cute β¨π«Ά
π¦ where this page comes from
- ubuntu jammy: clang-format-11 1:11.1.0-6 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms