summaryrefslogtreecommitdiff
path: root/examples/example.py
diff options
context:
space:
mode:
authorJared Crapo <jared@kotfu.net>2017-08-21 20:39:43 -0600
committerJared Crapo <jared@kotfu.net>2017-08-21 20:39:43 -0600
commit6f14013a26d2c394d77f6da0682a68947d6dbb05 (patch)
tree32ffd0af6ec69d885fa24e4462bc1a316c5ba6a8 /examples/example.py
parent208fd69238c97a83c373343573e9f19c59124adc (diff)
downloadcmd2-git-6f14013a26d2c394d77f6da0682a68947d6dbb05.tar.gz
Make the same as test_transcription.py
Diffstat (limited to 'examples/example.py')
-rwxr-xr-xexamples/example.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/example.py b/examples/example.py
index 03508024..e4158f13 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -40,10 +40,11 @@ class CmdLineApp(Cmd):
# For option commands, pass a single argument string instead of a list of argument strings to the do_* methods
set_use_arg_list(False)
- @options([make_option('-p', '--piglatin', action="store_true", help="atinLay"),
- make_option('-s', '--shout', action="store_true", help="N00B EMULATION MODE"),
- make_option('-r', '--repeat', type="int", help="output [n] times")
- ])
+ opts = [make_option('-p', '--piglatin', action="store_true", help="atinLay"),
+ make_option('-s', '--shout', action="store_true", help="N00B EMULATION MODE"),
+ make_option('-r', '--repeat', type="int", help="output [n] times")]
+
+ @options(opts, arg_desc='(text to say)')
def do_speak(self, arg, opts=None):
"""Repeats what you tell me to."""
arg = ''.join(arg)