Chromium Code Reviews| Index: third_party/WebKit/Source/build/scripts/gperf.py |
| diff --git a/third_party/WebKit/Source/build/scripts/gperf.py b/third_party/WebKit/Source/build/scripts/gperf.py |
| index 040cec67d3bb8b8d65a29f7693d8f04f28bba107..7e8eaee108f4e97170862900a851e953aad6b919 100644 |
| --- a/third_party/WebKit/Source/build/scripts/gperf.py |
| +++ b/third_party/WebKit/Source/build/scripts/gperf.py |
| @@ -2,11 +2,25 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| -# Invokes gperf for the GN build. The first argument is the path to gperf. |
| +# Invokes gperf for the GN build. |
| +# Usage: gperf.py [--developer_dir PATH_TO_XCODE] gperf ... |
|
Nico
2016/10/10 19:35:59
(fwiw you could use add_subparsers() to make sure
erikchen
2016/10/10 22:54:57
noted.
|
| # TODO(brettw) this can be removed once the run_executable rules have been |
| # checked in for the GN build. |
| +import argparse |
| +import os |
| import subprocess |
| import sys |
| -subprocess.check_call(sys.argv[1:]) |
| + |
| +def main(): |
| + parser = argparse.ArgumentParser() |
| + parser.add_argument("--developer_dir", required=False) |
| + args, unknownargs = parser.parse_known_args() |
| + if args.developer_dir: |
| + os.environ['DEVELOPER_DIR'] = args.developer_dir |
| + |
| + subprocess.check_call(unknownargs) |
| + |
| +if __name__ == '__main__': |
| + main() |