OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Redirects to the version of clang-format checked into the Chrome tree. | 6 """Redirects to the version of clang-format checked into the Chrome tree. |
7 | 7 |
8 clang-format binaries are pulled down from Google Cloud Storage whenever you | 8 clang-format binaries are pulled down from Google Cloud Storage whenever you |
9 sync Chrome, to platform-specific locations. This script knows how to locate | 9 sync Chrome, to platform-specific locations. This script knows how to locate |
10 those tools, assuming the script is invoked from inside a Chromium checkout.""" | 10 those tools, assuming the script is invoked from inside a Chromium checkout.""" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 except NotFoundError, e: | 55 except NotFoundError, e: |
56 print >> sys.stderr, e | 56 print >> sys.stderr, e |
57 sys.exit(1) | 57 sys.exit(1) |
58 | 58 |
59 # Add some visibility to --help showing where the tool lives, since this | 59 # Add some visibility to --help showing where the tool lives, since this |
60 # redirection can be a little opaque. | 60 # redirection can be a little opaque. |
61 help_syntax = ('-h', '--help', '-help', '-help-list', '--help-list') | 61 help_syntax = ('-h', '--help', '-help', '-help-list', '--help-list') |
62 if any(match in args for match in help_syntax): | 62 if any(match in args for match in help_syntax): |
63 print '\nDepot tools redirects you to the clang-format at:\n %s\n' % tool | 63 print '\nDepot tools redirects you to the clang-format at:\n %s\n' % tool |
64 | 64 |
65 return subprocess.call([tool] + sys.argv[1:]) | 65 return subprocess.call([tool] + args) |
tfarina
2015/02/28 18:59:27
Looks like this broke my setup!
Traceback (most r
| |
66 | 66 |
67 | 67 |
68 if __name__ == '__main__': | 68 if __name__ == '__main__': |
69 sys.exit(main(sys.argv)) | 69 try: |
70 sys.exit(main(sys.argv[1])) | |
yosin_UTC9
2015/02/28 13:11:56
Q: Is using |argv[1]| rather than |argv[1:]| inten
| |
71 except KeyboardInterrupt: | |
72 sys.stderr.write('interrupted\n') | |
73 sys.exit(1) | |
OLD | NEW |