Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: recipe_engine/run.py

Issue 2848443003: [recipes.py] add missing helpstrings, merge test subcommands into main parser. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/remote.py ('k') | recipe_engine/test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/run.py
diff --git a/recipe_engine/run.py b/recipe_engine/run.py
index cf9ec4bb78c1edde391af965326caaf3ba9a5423..bb8199aefdfe2046aaad6a050723a0075ac0f500 100644
--- a/recipe_engine/run.py
+++ b/recipe_engine/run.py
@@ -1,4 +1,4 @@
-# Copyright 2016 The LUCI Authors. All rights reserved.
+# Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
@@ -468,52 +468,55 @@ def add_subparser(parser):
raise argparse.ArgumentTypeError('must contain a JSON object, i.e. `{}`.')
return obj
+ helpstr='Run a recipe locally.'
run_p = parser.add_parser(
- 'run',
- description='Run a recipe locally')
+ 'run', help=helpstr, description=helpstr)
run_p.add_argument(
- '--workdir',
- type=os.path.abspath,
- help='The working directory of recipe execution')
+ '--workdir',
+ type=os.path.abspath,
+ help='The working directory of recipe execution')
run_p.add_argument(
- '--output-result-json',
- type=os.path.abspath,
- help='The file to write the JSON serialized returned value \
- of the recipe to')
+ '--output-result-json',
+ type=os.path.abspath,
+ help=(
+ 'The file to write the JSON serialized returned value '
+ ' of the recipe to'))
run_p.add_argument(
- '--timestamps',
- action='store_true',
- help='If true, emit CURRENT_TIMESTAMP annotations. '
- 'Default: false. '
- 'CURRENT_TIMESTAMP annotation has one parameter, current time in '
- 'Unix timestamp format. '
- 'CURRENT_TIMESTAMP annotation will be printed at the beginning and '
- 'end of the annotation stream and also immediately before each '
- 'STEP_STARTED and STEP_CLOSED annotations.',
- )
+ '--timestamps',
+ action='store_true',
+ help=(
+ 'If true, emit CURRENT_TIMESTAMP annotations. '
+ 'Default: false. '
+ 'CURRENT_TIMESTAMP annotation has one parameter, current time in '
+ 'Unix timestamp format. '
+ 'CURRENT_TIMESTAMP annotation will be printed at the beginning and '
+ 'end of the annotation stream and also immediately before each '
+ 'STEP_STARTED and STEP_CLOSED annotations.'))
prop_group = run_p.add_mutually_exclusive_group()
prop_group.add_argument(
- '--properties-file',
- dest='properties',
- type=properties_file_type,
- help=('A file containing a json blob of properties. '
- 'Pass "-" to read from stdin'))
+ '--properties-file',
+ dest='properties',
+ type=properties_file_type,
+ help=(
+ 'A file containing a json blob of properties. '
+ 'Pass "-" to read from stdin'))
prop_group.add_argument(
- '--properties',
- type=properties_type,
- help='A json string containing the properties')
+ '--properties',
+ type=properties_type,
+ help='A json string containing the properties')
run_p.add_argument(
- 'recipe',
- help='The recipe to execute')
+ 'recipe',
+ help='The recipe to execute')
run_p.add_argument(
- 'props',
- nargs=argparse.REMAINDER,
- type=parse_prop,
- help='A list of property pairs; e.g. mastername=chromium.linux '
- 'issue=12345. The property value will be decoded as JSON, but if '
- 'this decoding fails the value will be interpreted as a string.')
+ 'props',
+ nargs=argparse.REMAINDER,
+ type=parse_prop,
+ help=(
+ 'A list of property pairs; e.g. mastername=chromium.linux '
+ 'issue=12345. The property value will be decoded as JSON, but if '
+ 'this decoding fails the value will be interpreted as a string.'))
run_p.set_defaults(command='run', properties={}, func=main)
« no previous file with comments | « recipe_engine/remote.py ('k') | recipe_engine/test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698