From c9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 21 Jan 2018 22:24:09 -0500 Subject: Renamed @with_argument_parser decorator to @with_argparser Also: - Reanamed foo and bar subcommand methods to base_foo and base_bar --- examples/argparse_example.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/argparse_example.py') 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}'.format(args.tag, ' '.join(args.content))) -- cgit v1.2.1