diff options
Diffstat (limited to 'examples/example.py')
-rwxr-xr-x | examples/example.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/example.py b/examples/example.py index f07b9c74..264abd84 100755 --- a/examples/example.py +++ b/examples/example.py @@ -14,10 +14,10 @@ the transcript. import random import argparse -from cmd2.cmd2 import Cmd, with_argparser +import cmd2 -class CmdLineApp(Cmd): +class CmdLineApp(cmd2.Cmd): """ Example cmd2 application. """ # Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist @@ -43,7 +43,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_argparser(speak_parser) + @cmd2.with_argparser(speak_parser) def do_speak(self, args): """Repeats what you tell me to.""" words = [] @@ -65,7 +65,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_argparser(mumble_parser) + @cmd2.with_argparser(mumble_parser) def do_mumble(self, args): """Mumbles what you tell me to.""" repetitions = args.repeat or 1 |