OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """ | 6 """ |
7 Tool to perform checkouts in one easy command line! | 7 Tool to perform checkouts in one easy command line! |
8 | 8 |
9 Usage: | 9 Usage: |
10 fetch <recipe> [--property=value [--property2=value2 ...]] | 10 fetch <recipe> [--property=value [--property2=value2 ...]] |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 """ | 196 """ |
197 usage: %s [options] <recipe> [--property=value [--property2=value2 ...]] | 197 usage: %s [options] <recipe> [--property=value [--property2=value2 ...]] |
198 | 198 |
199 This script can be used to download the Chromium sources. See | 199 This script can be used to download the Chromium sources. See |
200 http://www.chromium.org/developers/how-tos/get-the-code | 200 http://www.chromium.org/developers/how-tos/get-the-code |
201 for full usage instructions. | 201 for full usage instructions. |
202 | 202 |
203 Valid options: | 203 Valid options: |
204 -h, --help, help Print this message. | 204 -h, --help, help Print this message. |
205 --nohooks Don't run hooks after checkout. | 205 --nohooks Don't run hooks after checkout. |
206 -n, --dryrun Don't run commands, only print them. | 206 -n, --dry-run Don't run commands, only print them. |
Dirk Pranke
2014/02/11 17:19:33
You're correctly identifying the bug: the usage do
wtc
2014/02/11 19:15:13
I'll be happy to make this change. But the CL is o
| |
207 """ % os.path.basename(sys.argv[0])) | 207 """ % os.path.basename(sys.argv[0])) |
208 sys.exit(bool(msg)) | 208 sys.exit(bool(msg)) |
209 | 209 |
210 | 210 |
211 def handle_args(argv): | 211 def handle_args(argv): |
212 """Gets the recipe name from the command line arguments.""" | 212 """Gets the recipe name from the command line arguments.""" |
213 if len(argv) <= 1: | 213 if len(argv) <= 1: |
214 usage('Must specify a recipe.') | 214 usage('Must specify a recipe.') |
215 if argv[1] in ('-h', '--help', 'help'): | 215 if argv[1] in ('-h', '--help', 'help'): |
216 usage() | 216 usage() |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 | 290 |
291 | 291 |
292 def main(): | 292 def main(): |
293 options, recipe, props = handle_args(sys.argv) | 293 options, recipe, props = handle_args(sys.argv) |
294 spec, root = run_recipe_fetch(recipe, props) | 294 spec, root = run_recipe_fetch(recipe, props) |
295 return run(options, spec, root) | 295 return run(options, spec, root) |
296 | 296 |
297 | 297 |
298 if __name__ == '__main__': | 298 if __name__ == '__main__': |
299 sys.exit(main()) | 299 sys.exit(main()) |
OLD | NEW |