From e3ed15ed375674729d65e4f594a8958ea91ae684 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 27 Aug 2020 20:56:56 -0400 Subject: Fixed issue where subcommand added with @as_subcommand_to decorator did not display help when called with -h/--help. 'add_help=False' no longer has to be passed to parsers used in @as_subcommand_to decorator. --- examples/modular_subcommands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/modular_subcommands.py') diff --git a/examples/modular_subcommands.py b/examples/modular_subcommands.py index 0b1f4ed3..94959349 100644 --- a/examples/modular_subcommands.py +++ b/examples/modular_subcommands.py @@ -24,7 +24,7 @@ class LoadableFruits(CommandSet): self._cmd.poutput('Apple') banana_description = "Cut a banana" - banana_parser = cmd2.Cmd2ArgumentParser(add_help=False, description=banana_description) + banana_parser = cmd2.Cmd2ArgumentParser(description=banana_description) banana_parser.add_argument('direction', choices=['discs', 'lengthwise']) @cmd2.as_subcommand_to('cut', 'banana', banana_parser, help=banana_description.lower()) @@ -42,7 +42,7 @@ class LoadableVegetables(CommandSet): self._cmd.poutput('Arugula') bokchoy_description = "Cut some bokchoy" - bokchoy_parser = cmd2.Cmd2ArgumentParser(add_help=False, description=bokchoy_description) + bokchoy_parser = cmd2.Cmd2ArgumentParser(description=bokchoy_description) bokchoy_parser.add_argument('style', choices=['quartered', 'diced']) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser, help=bokchoy_description.lower()) -- cgit v1.2.1