diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-05-25 12:35:24 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-05-25 12:35:24 -0400 |
commit | 4c67d3372db924e87be920d89aadecb946584b31 (patch) | |
tree | bf57a15570248a2e3fbfb058a817d6c743cc9167 /examples/example.py | |
parent | 0e4131ba2616bd33c9cb5e93105dbd6d511a71ab (diff) | |
parent | cad21a60fa92ebe4a7c177142d273f9f7497967b (diff) | |
download | cmd2-git-4c67d3372db924e87be920d89aadecb946584b31.tar.gz |
Merge branch 'master' into pyshell_readline
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 |