Scroll to navigation


NAME - manual page for 11


usage: [-h] [-i] [-p NUM] [-regex PATTERN]

[-iregex PATTERN] [-sort-includes] [-v]
[-style STYLE] [-binary BINARY]

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:

git diff -U0 --no-color --relative HEAD^ | -p1 -i svn diff --diff-cmd=diff -x-U0 | -i

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.

optional arguments:

show this help message and exit
apply edits to files instead of displaying a diff
strip the smallest prefix containing P slashes
custom pattern selecting file paths to reformat (case sensitive, overrides -iregex)
custom pattern selecting file paths to reformat (case insensitive, overridden by -regex)
let clang-format sort include blocks
be more verbose, ineffective without -i
formatting style to apply (LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit)
location of binary to use for clang-format
March 2021 11