From 9b2727babae61f6dabd27a1dad2918d06913b93b Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 14 Jun 2013 09:44:33 -0700 Subject: [PATCH] Bug 879406 - Unbust |mach help| when arguments are not prefixed with '-'; r=ted DONTBUILD (NPOTB) --- python/mach/mach/dispatcher.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/mach/mach/dispatcher.py b/python/mach/mach/dispatcher.py index f663912d7ce1..1eaceb91e658 100644 --- a/python/mach/mach/dispatcher.py +++ b/python/mach/mach/dispatcher.py @@ -177,8 +177,15 @@ class CommandAction(argparse.Action): # just the command data then supplement the main help's output with # this 2nd parser's. We use a custom formatter class to ignore some of # the help output. - c_parser = argparse.ArgumentParser(formatter_class=CommandFormatter, - add_help=False) + parser_args = { + 'formatter_class': CommandFormatter, + 'add_help': False, + } + + if handler.allow_all_arguments: + parser_args['prefix_chars'] = '+' + + c_parser = argparse.ArgumentParser(**parser_args) group = c_parser.add_argument_group('Command Arguments')