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. --- docs/features/modular_commands.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/features/modular_commands.rst') diff --git a/docs/features/modular_commands.rst b/docs/features/modular_commands.rst index 4abeda2d..43779872 100644 --- a/docs/features/modular_commands.rst +++ b/docs/features/modular_commands.rst @@ -244,7 +244,7 @@ command and each CommandSet def do_apple(self, _: cmd2.Statement): self._cmd.poutput('Apple') - banana_parser = cmd2.Cmd2ArgumentParser(add_help=False) + banana_parser = cmd2.Cmd2ArgumentParser() banana_parser.add_argument('direction', choices=['discs', 'lengthwise']) @cmd2.as_subcommand_to('cut', 'banana', banana_parser) @@ -261,7 +261,7 @@ command and each CommandSet def do_arugula(self, _: cmd2.Statement): self._cmd.poutput('Arugula') - bokchoy_parser = cmd2.Cmd2ArgumentParser(add_help=False) + bokchoy_parser = cmd2.Cmd2ArgumentParser() bokchoy_parser.add_argument('style', choices=['quartered', 'diced']) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser) -- cgit v1.2.1