Allow users to specify list of files/path to google-java-format
am: cc9b46c682

Change-Id: Ib0226d718d7a959ef15de6a6c4bfe582e7603107
diff --git a/tools/google-java-format.py b/tools/google-java-format.py
index b0b164c..0022c9d 100755
--- a/tools/google-java-format.py
+++ b/tools/google-java-format.py
@@ -52,6 +52,9 @@
     # default to not sort imports, while letting callers override as desired.
     parser.add_argument('--sort-imports', action='store_true',
                         help='If true, imports will be sorted.')
+    parser.add_argument('files', nargs='*',
+                        help='If specified, only consider differences in '
+                             'these files.')
     return parser
 
 
@@ -79,6 +82,7 @@
     # TODO: Delegate to the tool once this issue is resolved:
     # https://github.com/google/google-java-format/issues/107
     diff_cmd = ['git', 'diff', '--no-ext-diff', '-U0', '%s^!' % opts.commit]
+    diff_cmd.extend(['--'] + opts.files)
     diff = rh.utils.run_command(diff_cmd, capture_output=True).output
 
     cmd = [opts.google_java_format_diff, '-p1', '--aosp']