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/example.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/example.py') diff --git a/examples/example.py b/examples/example.py index 4ba0d29a..c66f0e60 100755 --- a/examples/example.py +++ b/examples/example.py @@ -14,7 +14,7 @@ the transcript. import random import argparse -from cmd2 import Cmd, with_argument_parser +from cmd2 import Cmd, with_argparser class CmdLineApp(Cmd): @@ -44,7 +44,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 = [] @@ -66,7 +66,7 @@ class CmdLineApp(Cmd): mumble_parser.add_argument('-r', '--repeat', type=int, help='how many times to repeat') mumble_parser.add_argument('words', nargs='+', help='words to say') - @with_argument_parser(mumble_parser) + @with_argparser(mumble_parser) def do_mumble(self, args): """Mumbles what you tell me to.""" repetitions = args.repeat or 1 -- cgit v1.2.1