Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Invokes gperf for the GN build. The first argument is the path to gperf. | 5 # Invokes gperf for the GN build. |
| 6 # 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.
| |
| 6 # TODO(brettw) this can be removed once the run_executable rules have been | 7 # TODO(brettw) this can be removed once the run_executable rules have been |
| 7 # checked in for the GN build. | 8 # checked in for the GN build. |
| 8 | 9 |
| 10 import argparse | |
| 11 import os | |
| 9 import subprocess | 12 import subprocess |
| 10 import sys | 13 import sys |
| 11 | 14 |
| 12 subprocess.check_call(sys.argv[1:]) | 15 |
| 16 def main(): | |
| 17 parser = argparse.ArgumentParser() | |
| 18 parser.add_argument("--developer_dir", required=False) | |
| 19 args, unknownargs = parser.parse_known_args() | |
| 20 if args.developer_dir: | |
| 21 os.environ['DEVELOPER_DIR'] = args.developer_dir | |
| 22 | |
| 23 subprocess.check_call(unknownargs) | |
| 24 | |
| 25 if __name__ == '__main__': | |
| 26 main() | |
| OLD | NEW |