mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1255467 - Ability for a mach command to dispatch to another's subcommand, r=gps
MozReview-Commit-ID: CN8kJU0NrL0 --HG-- extra : rebase_source : 673041aaeaa48cb32c68955e0448737e1ebbc459
This commit is contained in:
parent
c77c969418
commit
67699efe5c
@ -99,14 +99,16 @@ class MachRegistrar(object):
|
||||
|
||||
return result
|
||||
|
||||
def dispatch(self, name, context=None, argv=None, **kwargs):
|
||||
def dispatch(self, name, context=None, argv=None, subcommand=None, **kwargs):
|
||||
"""Dispatch/run a command.
|
||||
|
||||
Commands can use this to call other commands.
|
||||
"""
|
||||
# TODO handler.subcommand_handlers are ignored
|
||||
handler = self.command_handlers[name]
|
||||
|
||||
if subcommand:
|
||||
handler = handler.subcommand_handlers[subcommand]
|
||||
|
||||
if handler.parser:
|
||||
parser = handler.parser
|
||||
|
||||
@ -121,5 +123,4 @@ class MachRegistrar(object):
|
||||
return self._run_command_handler(handler, context=context, **kwargs)
|
||||
|
||||
|
||||
|
||||
Registrar = MachRegistrar()
|
||||
|
Loading…
Reference in New Issue
Block a user