diff options
Diffstat (limited to 'examples/example.py')
-rwxr-xr-x | examples/example.py | 9 |
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) |