diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-09-03 23:21:50 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-09-03 23:21:50 -0400 |
| commit | 7d3f27273e64f4c30852ea1f7fe0b79520f6cc7e (patch) | |
| tree | 340a418a46e66c407898fc91fea4813b6f5161a0 /examples | |
| parent | f1ac4d0fb0e6cccbc0e180b6d3320f48015fad41 (diff) | |
| parent | de0261325a91dfdbe1571135ce078a978a2aaad8 (diff) | |
| download | cmd2-git-7d3f27273e64f4c30852ea1f7fe0b79520f6cc7e.tar.gz | |
Merge branch '2.0' into read_input
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/modular_commands/commandset_complex.py | 4 | ||||
| -rw-r--r-- | examples/modular_commands_dynamic.py | 2 | ||||
| -rw-r--r-- | examples/modular_subcommands.py | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py index a4343ae3..94f8b5f4 100644 --- a/examples/modular_commands/commandset_complex.py +++ b/examples/modular_commands/commandset_complex.py @@ -19,7 +19,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) @@ -43,7 +43,7 @@ class CommandSetA(cmd2.CommandSet): def complete_durian(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: return self._cmd.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..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') @@ -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) |
