summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-22 21:07:06 -0500
committerGitHub <noreply@github.com>2018-01-22 21:07:06 -0500
commitddfd3d9a400ae81468e9abcc89fe690c30b7ec7f (patch)
tree720e9b58b694dff8f8c2513918e16a11ea24321f /examples/arg_print.py
parent7b564b4424accfbd7439de10a169d9b64bc599c5 (diff)
parent504e3dbf9e15faf34611aae8ddabecb90e86eda5 (diff)
downloadcmd2-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-xexamples/arg_print.py4
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))