diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-21 22:24:09 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-21 22:24:09 -0500 |
commit | c9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b (patch) | |
tree | e2e2f7f6ade5e61a625a3737106918e5e4362aaa /examples/arg_print.py | |
parent | 711d6380d347260a99d9ed77ce0afa7cdae67da7 (diff) | |
download | cmd2-git-c9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b.tar.gz |
Renamed @with_argument_parser decorator to @with_argparser
Also:
- Reanamed foo and bar subcommand methods to base_foo and base_bar
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)) |