r196336 - clang-format-diff.py: Fix 'beintroduced' in help output

Alp Toker alp at nuanti.com
Tue Dec 3 16:48:22 PST 2013


Author: alp
Date: Tue Dec  3 18:48:22 2013
New Revision: 196336

URL: http://llvm.org/viewvc/llvm-project?rev=196336&view=rev
Log:
clang-format-diff.py: Fix 'beintroduced' in help output

Also update docs to reflect recently changed -i inplace edit behaviour.

Modified:
    cfe/trunk/docs/ClangFormat.rst
    cfe/trunk/tools/clang-format/clang-format-diff.py

Modified: cfe/trunk/docs/ClangFormat.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormat.rst?rev=196336&r1=196335&r2=196336&view=diff
==============================================================================
--- cfe/trunk/docs/ClangFormat.rst (original)
+++ cfe/trunk/docs/ClangFormat.rst Tue Dec  3 18:48:22 2013
@@ -146,7 +146,7 @@ shortcut in the BBEdit preferences, unde
 Visual Studio Integration
 =========================
 
-Download the latest Visual Studio plugin from the `alpha build site
+Download the latest Visual Studio extension from the `alpha build site
 <http://llvm.org/builds/>`_. The default key-binding is Ctrl-R,Ctrl-F.
 
 
@@ -158,12 +158,14 @@ a unified diff and reformats all contain
 
 .. code-block:: console
 
-  usage: clang-format-diff.py [-h] [-p P] [-style STYLE]
+  usage: clang-format-diff.py [-h] [-i] [-p P] [-style STYLE]
 
-  Reformat changed lines in diff.
+  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)
@@ -172,7 +174,7 @@ So to reformat all the lines in the late
 
 .. code-block:: console
 
-  git diff -U0 HEAD^ | clang-format-diff.py -p1
+  git diff -U0 HEAD^ | clang-format-diff.py -i -p1
 
 The :option:`-U0` will create a diff without context lines (the script would format
 those as well).

Modified: cfe/trunk/tools/clang-format/clang-format-diff.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py?rev=196336&r1=196335&r2=196336&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/clang-format-diff.py (original)
+++ cfe/trunk/tools/clang-format/clang-format-diff.py Tue Dec  3 18:48:22 2013
@@ -37,7 +37,7 @@ binary = 'clang-format'
 def main():
   parser = argparse.ArgumentParser(description=
                                    'Reformat changed lines in diff. Without -i '
-                                   'option just output the diff that would be'
+                                   'option just output the diff that would be '
                                    'introduced.')
   parser.add_argument('-i', action='store_true', default=False,
                       help='apply edits to files instead of displaying a diff')





More information about the cfe-commits mailing list