diff --git a/tools/tryselect/mach_commands.py b/tools/tryselect/mach_commands.py index 4bf51d0e6683..2c5c23dd7019 100644 --- a/tools/tryselect/mach_commands.py +++ b/tools/tryselect/mach_commands.py @@ -38,9 +38,13 @@ def fuzzy_parser(): return FuzzyParser() -def generic_parser(): +def base_parser(): from tryselect.cli import BaseTryParser - parser = BaseTryParser() + return BaseTryParser() + + +def generic_parser(): + parser = base_parser() parser.add_argument('argv', nargs=argparse.REMAINDER) return parser @@ -144,8 +148,9 @@ class TrySelect(MachCommandBase): @SubCommand('try', 'empty', - description='Push to try without scheduling any tasks.') - def try_empty(self): + description='Push to try without scheduling any tasks.', + parser=base_parser) + def try_empty(self, **kwargs): """Push to try, running no builds or tests This selector does not prompt you to run anything, it just pushes @@ -155,7 +160,7 @@ class TrySelect(MachCommandBase): menu. """ from tryselect.selectors.empty import run_empty_try - return run_empty_try() + return run_empty_try(**kwargs) @SubCommand('try', 'syntax', diff --git a/tools/tryselect/selectors/empty.py b/tools/tryselect/selectors/empty.py index a4a8ddd183f7..34d662e528cb 100644 --- a/tools/tryselect/selectors/empty.py +++ b/tools/tryselect/selectors/empty.py @@ -7,6 +7,7 @@ from __future__ import absolute_import, print_function, unicode_literals from ..vcs import VCSHelper -def run_empty_try(): +def run_empty_try(message='{msg}', push=True, **kwargs): vcs = VCSHelper.create() - return vcs.push_to_try("empty", "", []) + msg = 'No try selector specified, use "Add New Jobs" to select tasks.' + return vcs.push_to_try('empty', message.format(msg=msg), [], push=push)