.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. .TH CLANG-FORMAT "1" "May 2022" "clang-format 12" "User Commands" .SH NAME clang-format \- manual page for clang-format 12 .SH DESCRIPTION OVERVIEW: A tool to format C/C++/Java/JavaScript/Objective\-C/Protobuf/C# code. .PP If no arguments are specified, it formats the code from standard input and writes the result to the standard output. If s are given, it reformats the files. If \fB\-i\fR is specified together with s, the files are edited in\-place. Otherwise, the result is written to the standard output. .PP USAGE: clang\-format [options] [ ...] .PP OPTIONS: .PP Clang\-format options: .HP \fB\-\-Werror\fR \- If set, changes formatting warnings to errors .HP \fB\-\-Wno\-error=\fR \- If set don't error out on the specified warning type. .TP =unknown \- If set, unknown format options are only warned about. .TP This can be used to enable formatting, even if the configuration contains unknown (newer) options. Use with caution, as this might lead to dramatically differing format depending on an option being supported or not. .TP \fB\-\-assume\-filename=\fR \- Override filename used to determine the language. When reading from stdin, clang\-format assumes this filename to determine the language. .TP \fB\-\-cursor=\fR \- The position of the cursor when invoking clang\-format from an editor integration .HP \fB\-\-dry\-run\fR \- If set, do not actually make the formatting changes .TP \fB\-\-dump\-config\fR \- Dump configuration options to stdout and exit. Can be used with \fB\-style\fR option. .TP \fB\-\-fallback\-style=\fR \- The name of the predefined style used as a fallback in case clang\-format is invoked with \fB\-style\fR=\fI\,file\/\fR, but can not find the .clang\-format file to use. Use \fB\-fallback\-style\fR=\fI\,none\/\fR to skip formatting. .HP \fB\-\-ferror\-limit=\fR \- Set the maximum number of clang\-format errors to emit before stopping (0 = no limit). Used only with \fB\-\-dry\-run\fR or \fB\-n\fR .HP \fB\-i\fR \- Inplace edit s, if specified. .TP \fB\-\-length=\fR \- Format a range of this length (in bytes). Multiple ranges can be formatted by specifying several \fB\-offset\fR and \fB\-length\fR pairs. When only a single \fB\-offset\fR is specified without \fB\-length\fR, clang\-format will format up to the end of the file. Can only be used with one input file. .TP \fB\-\-lines=\fR \- : \- format a range of lines (both 1\-based). Multiple ranges can be formatted by specifying several \fB\-lines\fR arguments. Can't be used with \fB\-offset\fR and \fB\-length\fR. Can only be used with one input file. .HP \fB\-n\fR \- Alias for \fB\-\-dry\-run\fR .TP \fB\-\-offset=\fR \- Format a range starting at this byte offset. Multiple ranges can be formatted by specifying several \fB\-offset\fR and \fB\-length\fR pairs. Can only be used with one input file. .HP \fB\-\-output\-replacements\-xml\fR \- Output replacements as XML. .HP \fB\-\-sort\-includes\fR \- If set, overrides the include sorting behavior determined by the SortIncludes style flag .TP \fB\-\-style=\fR \- Coding style, currently supports: LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit. .TP Use \fB\-style\fR=\fI\,file\/\fR 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 \fB\-style=\fR"{key: value, ...}" to set specific parameters, e.g.: .IP \fB\-style=\fR"{BasedOnStyle: llvm, IndentWidth: 8}" .HP \fB\-\-verbose\fR \- If set, shows the list of processed files .PP Generic Options: .HP \fB\-\-help\fR \- Display available options (\fB\-\-help\-hidden\fR for more) .HP \fB\-\-help\-list\fR \- Display list of available options (\fB\-\-help\-list\-hidden\fR for more) .HP \fB\-\-version\fR \- Display the version of this program