r221990 - clang-format: Give clang-format-diff.py a -v option.

Daniel Jasper djasper at google.com
Fri Nov 14 05:27:28 PST 2014


Author: djasper
Date: Fri Nov 14 07:27:28 2014
New Revision: 221990

URL: http://llvm.org/viewvc/llvm-project?rev=221990&view=rev
Log:
clang-format: Give clang-format-diff.py a -v option.

With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.

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

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=221990&r1=221989&r2=221990&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/clang-format-diff.py (original)
+++ cfe/trunk/tools/clang-format/clang-format-diff.py Fri Nov 14 07:27:28 2014
@@ -52,6 +52,8 @@ def main():
                       r'|protodevel)',
                       help='custom pattern selecting file paths to reformat '
                       '(case insensitive, overridden by -regex)')
+  parser.add_argument('-v', '--verbose', action='store_true',
+                      help='be more verbose, ineffective without -i')
   parser.add_argument(
       '-style',
       help=
@@ -89,6 +91,8 @@ def main():
 
   # Reformat files containing changes in place.
   for filename, lines in lines_by_file.iteritems():
+    if args.i and args.verbose:
+      print 'Formatting', filename
     command = [binary, filename]
     if args.i:
       command.append('-i')





More information about the cfe-commits mailing list