From 72fc6bf105f4b712d5a6f991746fd2f9084893fc Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 1 Sep 2020 20:20:34 -0400 Subject: Updated docs --- examples/modular_commands/commandset_complex.py | 4 ++-- examples/modular_commands_dynamic.py | 2 +- examples/modular_subcommands.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py index 7c6b1300..579c0677 100644 --- a/examples/modular_commands/commandset_complex.py +++ b/examples/modular_commands/commandset_complex.py @@ -20,7 +20,7 @@ class CommandSetA(cmd2.CommandSet): """Banana Command""" self._cmd.poutput('Banana!!') - cranberry_parser = cmd2.Cmd2ArgumentParser('cranberry') + cranberry_parser = cmd2.Cmd2ArgumentParser() cranberry_parser.add_argument('arg1', choices=['lemonade', 'juice', 'sauce']) @cmd2.with_argparser(cranberry_parser, with_unknown_args=True) @@ -44,7 +44,7 @@ class CommandSetA(cmd2.CommandSet): def complete_durian(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: return utils.basic_complete(text, line, begidx, endidx, ['stinks', 'smells', 'disgusting']) - elderberry_parser = cmd2.Cmd2ArgumentParser('elderberry') + elderberry_parser = cmd2.Cmd2ArgumentParser() elderberry_parser.add_argument('arg1') @cmd2.with_category('Alone') diff --git a/examples/modular_commands_dynamic.py b/examples/modular_commands_dynamic.py index eb6283a7..b2be5dd1 100644 --- a/examples/modular_commands_dynamic.py +++ b/examples/modular_commands_dynamic.py @@ -50,7 +50,7 @@ class ExampleApp(cmd2.Cmd): self._fruits = LoadableFruits() self._vegetables = LoadableVegetables() - load_parser = cmd2.Cmd2ArgumentParser('load') + load_parser = cmd2.Cmd2ArgumentParser() load_parser.add_argument('cmds', choices=['fruits', 'vegetables']) @with_argparser(load_parser) diff --git a/examples/modular_subcommands.py b/examples/modular_subcommands.py index 94959349..4445fde2 100644 --- a/examples/modular_subcommands.py +++ b/examples/modular_subcommands.py @@ -62,7 +62,7 @@ class ExampleApp(cmd2.Cmd): self._fruits = LoadableFruits() self._vegetables = LoadableVegetables() - load_parser = cmd2.Cmd2ArgumentParser('load') + load_parser = cmd2.Cmd2ArgumentParser() load_parser.add_argument('cmds', choices=['fruits', 'vegetables']) @with_argparser(load_parser) @@ -92,7 +92,7 @@ class ExampleApp(cmd2.Cmd): self.unregister_command_set(self._vegetables) self.poutput('Vegetables unloaded') - cut_parser = cmd2.Cmd2ArgumentParser('cut') + cut_parser = cmd2.Cmd2ArgumentParser() cut_subparsers = cut_parser.add_subparsers(title='item', help='item to cut') @with_argparser(cut_parser) -- cgit v1.2.1 From 1054dda76b87d9f7f77311d8d804c1017b668996 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 3 Sep 2020 23:04:54 -0400 Subject: Fixed type hints in example code --- examples/modular_subcommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/modular_subcommands.py b/examples/modular_subcommands.py index 4445fde2..c1d499f0 100644 --- a/examples/modular_subcommands.py +++ b/examples/modular_subcommands.py @@ -46,7 +46,7 @@ class LoadableVegetables(CommandSet): bokchoy_parser.add_argument('style', choices=['quartered', 'diced']) @cmd2.as_subcommand_to('cut', 'bokchoy', bokchoy_parser, help=bokchoy_description.lower()) - def cut_bokchoy(self, _: cmd2.Statement): + def cut_bokchoy(self, _: argparse.Namespace): self._cmd.poutput('Bok Choy') -- cgit v1.2.1