[PATCH] D64998: Improve clang-format-diff help output

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 10:36:47 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366828: Improve clang-format-diff help output (authored by nico, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64998?vs=210837&id=211331#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64998/new/

https://reviews.llvm.org/D64998

Files:
  cfe/trunk/tools/clang-format/clang-format-diff.py


Index: cfe/trunk/tools/clang-format/clang-format-diff.py
===================================================================
--- cfe/trunk/tools/clang-format/clang-format-diff.py
+++ cfe/trunk/tools/clang-format/clang-format-diff.py
@@ -8,10 +8,7 @@
 #
 #===------------------------------------------------------------------------===#
 
-r"""
-ClangFormat Diff Reformatter
-============================
-
+"""
 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:
@@ -35,10 +32,9 @@
 
 
 def main():
-  parser = argparse.ArgumentParser(description=
-                                   'Reformat changed lines in diff. Without -i '
-                                   'option just output the diff that would be '
-                                   'introduced.')
+  parser = argparse.ArgumentParser(description=__doc__,
+                                   formatter_class=
+                                           argparse.RawDescriptionHelpFormatter)
   parser.add_argument('-i', action='store_true', default=False,
                       help='apply edits to files instead of displaying a diff')
   parser.add_argument('-p', metavar='NUM', default=0,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64998.211331.patch
Type: text/x-patch
Size: 1289 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190723/bc571f47/attachment.bin>


More information about the llvm-commits mailing list