summaryrefslogtreecommitdiff
path: root/examples/modular_subcommands.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-03 23:21:39 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-03 23:21:39 -0400
commitde0261325a91dfdbe1571135ce078a978a2aaad8 (patch)
treea57ce89e0465aaa3ed2feb46aef359fe18c07071 /examples/modular_subcommands.py
parentdf703af969219665b7d672025bf9b26f75a76285 (diff)
parent1054dda76b87d9f7f77311d8d804c1017b668996 (diff)
downloadcmd2-git-de0261325a91dfdbe1571135ce078a978a2aaad8.tar.gz
Merge branch 'master' into 2.0
Diffstat (limited to 'examples/modular_subcommands.py')
-rw-r--r--examples/modular_subcommands.py6
1 files changed, 3 insertions, 3 deletions
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)