OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
7 | 7 |
8 Files | 8 Files |
9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1167 |
1168 def Main(argv): | 1168 def Main(argv): |
1169 """Doesn't parse the arguments here, just find the right subcommand to | 1169 """Doesn't parse the arguments here, just find the right subcommand to |
1170 execute.""" | 1170 execute.""" |
1171 try: | 1171 try: |
1172 # Do it late so all commands are listed. | 1172 # Do it late so all commands are listed. |
1173 CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([ | 1173 CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([ |
1174 ' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip()) | 1174 ' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip()) |
1175 for fn in dir(sys.modules[__name__]) if fn.startswith('CMD')])) | 1175 for fn in dir(sys.modules[__name__]) if fn.startswith('CMD')])) |
1176 parser = optparse.OptionParser(version='%prog ' + __version__) | 1176 parser = optparse.OptionParser(version='%prog ' + __version__) |
1177 parser.add_option('-j', '--jobs', default=1, type='int', | 1177 parser.add_option('-j', '--jobs', default=8, type='int', |
1178 help='Specify how many SCM commands can run in parallel') | 1178 help='Specify how many SCM commands can run in parallel; ' |
| 1179 'default=%default') |
1179 parser.add_option('-v', '--verbose', action='count', default=0, | 1180 parser.add_option('-v', '--verbose', action='count', default=0, |
1180 help='Produces additional output for diagnostics. Can be ' | 1181 help='Produces additional output for diagnostics. Can be ' |
1181 'used up to three times for more logging info.') | 1182 'used up to three times for more logging info.') |
1182 parser.add_option('--gclientfile', dest='config_filename', | 1183 parser.add_option('--gclientfile', dest='config_filename', |
1183 default=os.environ.get('GCLIENT_FILE', '.gclient'), | 1184 default=os.environ.get('GCLIENT_FILE', '.gclient'), |
1184 help='Specify an alternate %default file') | 1185 help='Specify an alternate %default file') |
1185 # Integrate standard options processing. | 1186 # Integrate standard options processing. |
1186 old_parser = parser.parse_args | 1187 old_parser = parser.parse_args |
1187 def Parse(args): | 1188 def Parse(args): |
1188 (options, args) = old_parser(args) | 1189 (options, args) = old_parser(args) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 return CMDhelp(parser, argv) | 1229 return CMDhelp(parser, argv) |
1229 except gclient_utils.Error, e: | 1230 except gclient_utils.Error, e: |
1230 print >> sys.stderr, 'Error: %s' % str(e) | 1231 print >> sys.stderr, 'Error: %s' % str(e) |
1231 return 1 | 1232 return 1 |
1232 | 1233 |
1233 | 1234 |
1234 if '__main__' == __name__: | 1235 if '__main__' == __name__: |
1235 sys.exit(Main(sys.argv[1:])) | 1236 sys.exit(Main(sys.argv[1:])) |
1236 | 1237 |
1237 # vim: ts=2:sw=2:tw=80:et: | 1238 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |