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/argparse_example.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/argparse_example.py')
-rwxr-xr-x | examples/argparse_example.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/argparse_example.py b/examples/argparse_example.py index 9f6548de..fbb2b1dc 100755 --- a/examples/argparse_example.py +++ b/examples/argparse_example.py @@ -14,7 +14,7 @@ verifying that the output produced matches the transcript. import argparse import sys -from cmd2 import Cmd, options, with_argument_parser, with_argument_list +from cmd2 import Cmd, options, with_argparser, with_argument_list from optparse import make_option @@ -47,7 +47,7 @@ class CmdLineApp(Cmd): speak_parser.add_argument('-r', '--repeat', type=int, help='output [n] times') speak_parser.add_argument('words', nargs='+', help='words to say') - @with_argument_parser(speak_parser) + @with_argparser(speak_parser) def do_speak(self, args): """Repeats what you tell me to.""" words = [] @@ -68,7 +68,7 @@ class CmdLineApp(Cmd): tag_parser.add_argument('tag', help='tag') tag_parser.add_argument('content', nargs='+', help='content to surround with tag') - @with_argument_parser(tag_parser) + @with_argparser(tag_parser) def do_tag(self, args): """create a html tag""" self.poutput('<{0}>{1}</{0}>'.format(args.tag, ' '.join(args.content))) |