.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.1. .TH CLANG-FORMAT-DIFF.PY "1" "June 2022" "clang-format-diff.py 13" "User Commands" .SH NAME clang-format-diff.py \- manual page for clang-format-diff.py 13 .SH DESCRIPTION usage: clang\-format\-diff.py [\-h] [\-i] [\-p NUM] [\-regex PATTERN] .TP [\-iregex PATTERN] [\-sort\-includes] [\-v] [\-style STYLE] [\-binary BINARY] .PP This script reads input from a unified diff and reformats all the changed lines. This is useful to reformat all the lines touched by a specific patch. Example usage for git/svn users: .IP git diff \fB\-U0\fR \fB\-\-no\-color\fR \fB\-\-relative\fR HEAD^ | clang\-format\-diff.py \fB\-p1\fR \fB\-i\fR svn diff \fB\-\-diff\-cmd\fR=\fI\,diff\/\fR \fB\-x\-U0\fR | clang\-format\-diff.py \fB\-i\fR .PP It should be noted that the filename contained in the diff is used unmodified to determine the source file to update. Users calling this script directly should be careful to ensure that the path in the diff is correct relative to the current working directory. .SS "optional arguments:" .TP \fB\-h\fR, \fB\-\-help\fR show this help message and exit .TP \fB\-i\fR apply edits to files instead of displaying a diff .TP \fB\-p\fR NUM strip the smallest prefix containing P slashes .TP \fB\-regex\fR PATTERN custom pattern selecting file paths to reformat (case sensitive, overrides \fB\-iregex\fR) .TP \fB\-iregex\fR PATTERN custom pattern selecting file paths to reformat (case insensitive, overridden by \fB\-regex\fR) .TP \fB\-sort\-includes\fR let clang\-format sort include blocks .TP \fB\-v\fR, \fB\-\-verbose\fR be more verbose, ineffective without \fB\-i\fR .TP \fB\-style\fR STYLE formatting style to apply (LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit) .TP \fB\-binary\fR BINARY location of binary to use for clang\-format