summaryrefslogtreecommitdiff
path: root/examples/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example.py')
-rwxr-xr-xexamples/example.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/example.py b/examples/example.py
index 68e08890..fd886a76 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -14,15 +14,18 @@ from cmd2 import Cmd, make_option, options, set_use_arg_list
class CmdLineApp(Cmd):
""" Example cmd2 application. """
- multilineCommands = ['orate']
- Cmd.shortcuts.update({'&': 'speak'})
- maxrepeats = 3
- Cmd.settable.append('maxrepeats')
# Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist
# default_to_shell = True
def __init__(self):
+ self.multilineCommands = ['orate']
+ self.maxrepeats = 3
+
+ # Add stuff to settable and shortcutgs before calling base class initializer
+ self.settable['maxrepeats'] = 'max repetitions for speak command'
+ self.shortcuts.update({'&': 'speak'})
+
# Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
Cmd.__init__(self, use_ipython=False)