diff options
author | Alp Toker <alp@nuanti.com> | 2013-12-10 13:51:53 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-12-10 13:51:53 +0000 |
commit | 8c7cbdf53ad0d0dc596dea63be31520a2d7e1819 (patch) | |
tree | cdb2c2eb8779cdd22b3686ff6e888d61a50bbaa8 /clang/docs/ClangFormat.rst | |
parent | ac85179219ca168322fe25e5ed4ce174e2f741a4 (diff) | |
download | llvm-8c7cbdf53ad0d0dc596dea63be31520a2d7e1819.zip llvm-8c7cbdf53ad0d0dc596dea63be31520a2d7e1819.tar.gz llvm-8c7cbdf53ad0d0dc596dea63be31520a2d7e1819.tar.bz2 |
clang-format-diff.py: Support -regex filter and more filename extensions
Add support for more filename extensions based on the list in the clang
plus JavaScript.
Also adds a -regex option so users can override defaults if they have unusual
file extensions or want to format everything in the diff.
Keeping with tradition the flag is modelled on Unix conventions, this time
matching the semantics of find(1).
llvm-svn: 196917
Diffstat (limited to 'clang/docs/ClangFormat.rst')
-rw-r--r-- | clang/docs/ClangFormat.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst index d760bbb..3f8499b 100644 --- a/clang/docs/ClangFormat.rst +++ b/clang/docs/ClangFormat.rst @@ -158,17 +158,18 @@ a unified diff and reformats all contained lines with :program:`clang-format`. .. code-block:: console - usage: clang-format-diff.py [-h] [-i] [-p P] [-style STYLE] + usage: clang-format-diff.py [-h] [-i] [-p NUM] [-regex PATTERN] [-style STYLE] Reformat changed lines in diff. Without -i option just output the diff that would be introduced. optional arguments: - -h, --help show this help message and exit - -i apply edits to files instead of displaying a diff - -p P strip the smallest prefix containing P slashes - -style STYLE formatting style to apply (LLVM, Google, Chromium, Mozilla, - WebKit) + -h, --help show this help message and exit + -i apply edits to files instead of displaying a diff + -p NUM strip the smallest prefix containing P slashes + -regex PATTERN custom pattern selecting file paths to reformat + -style STYLE formatting style to apply (LLVM, Google, Chromium, Mozilla, + WebKit) So to reformat all the lines in the latest :program:`git` commit, just do: |