diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-20 13:30:19 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-20 13:30:19 -0500 |
commit | 74ad43dffd9aba2ff17a6e7e2948681745a5a4bf (patch) | |
tree | 8e39c65a9b00c4f3ed3c4a3b180ab9582b19758b /examples/subcommands.py | |
parent | 014371fd1353c6f585e7be18bc3a2dc6ef4fd397 (diff) | |
download | cmd2-git-74ad43dffd9aba2ff17a6e7e2948681745a5a4bf.tar.gz |
Just improved a few comments in the subcommands.py example
Diffstat (limited to 'examples/subcommands.py')
-rwxr-xr-x | examples/subcommands.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/subcommands.py b/examples/subcommands.py index 347cb61d..7cab74dd 100755 --- a/examples/subcommands.py +++ b/examples/subcommands.py @@ -27,17 +27,17 @@ class SubcommandsExample(cmd2.Cmd): """bar sucommand of base command""" print('((%s))' % args.z) - # create the top-level parser + # create the top-level parser for the base command base_parser = argparse.ArgumentParser(prog='base') base_subparsers = base_parser.add_subparsers(title='subcommands', help='subcommand help') - # create the parser for the "foo" command + # create the parser for the "foo" sub-command parser_foo = base_subparsers.add_parser('foo', help='foo help') parser_foo.add_argument('-x', type=int, default=1, help='integer') parser_foo.add_argument('y', type=float, help='float') parser_foo.set_defaults(func=foo) - # create the parser for the "bar" command + # create the parser for the "bar" sub-command parser_bar = base_subparsers.add_parser('bar', help='bar help') parser_bar.add_argument('z', help='string') parser_bar.set_defaults(func=bar) |