summaryrefslogtreecommitdiff
path: root/examples/example.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-21 22:24:09 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-21 22:24:09 -0500
commitc9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b (patch)
treee2e2f7f6ade5e61a625a3737106918e5e4362aaa /examples/example.py
parent711d6380d347260a99d9ed77ce0afa7cdae67da7 (diff)
downloadcmd2-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/example.py')
-rwxr-xr-xexamples/example.py6
1 files changed, 3 insertions, 3 deletions
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