diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-22 21:07:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-22 21:07:06 -0500 |
commit | ddfd3d9a400ae81468e9abcc89fe690c30b7ec7f (patch) | |
tree | 720e9b58b694dff8f8c2513918e16a11ea24321f /examples/arg_print.py | |
parent | 7b564b4424accfbd7439de10a169d9b64bc599c5 (diff) | |
parent | 504e3dbf9e15faf34611aae8ddabecb90e86eda5 (diff) | |
download | cmd2-git-ddfd3d9a400ae81468e9abcc89fe690c30b7ec7f.tar.gz |
Merge pull request #257 from python-cmd2/sub-commands
Sub-commands and automatic transcript generation
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-x | examples/arg_print.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py index 1b18cdf0..8b02bc51 100755 --- a/examples/arg_print.py +++ b/examples/arg_print.py @@ -14,7 +14,7 @@ import argparse import cmd2 import pyparsing -from cmd2 import with_argument_list, with_argument_parser, with_argparser_and_unknown_args +from cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args class ArgumentAndOptionPrinter(cmd2.Cmd): @@ -47,7 +47,7 @@ class ArgumentAndOptionPrinter(cmd2.Cmd): oprint_parser.add_argument('-r', '--repeat', type=int, help='output [n] times') oprint_parser.add_argument('words', nargs='+', help='words to print') - @with_argument_parser(oprint_parser) + @with_argparser(oprint_parser) def do_oprint(self, args): """Print the options and argument list this options command was called with.""" print('oprint was called with the following\n\toptions: {!r}'.format(args)) |