]> granicus.if.org Git - clang/commitdiff
clang-format: Give clang-format-diff.py a -v option.
authorDaniel Jasper <djasper@google.com>
Fri, 14 Nov 2014 13:27:28 +0000 (13:27 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 14 Nov 2014 13:27:28 +0000 (13:27 +0000)
With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221990 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-format/clang-format-diff.py

index b896ffce932bd036c7fe24f636d763507fa0bd88..247dace9be042ff378dd1cd64fd8ac3398f7593c 100755 (executable)
@@ -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')