summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-13 23:33:58 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-13 23:33:58 -0400
commit88b45e12b0c2c9e7f8e386504f2d6808f396560b (patch)
tree66209a092dc11528f73a9cb1a991c620be09a815 /README.md
parent23fad46d5187600d52b95125bb1629e491cb9e6f (diff)
downloadcmd2-git-88b45e12b0c2c9e7f8e386504f2d6808f396560b.tar.gz
First stage of attribute refactoring
The following are now arguments to cmd2.Cmd.__init__() instead of class attributes: * allow_redirection * multiline_commands * terminators * shortcuts Added a couple read-only properties for convenience of cmd2.Cmd accessing immutable members from self.statement_parser
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md9
1 files changed, 4 insertions, 5 deletions
diff --git a/README.md b/README.md
index 6b33ab84..65a24b8b 100755
--- a/README.md
+++ b/README.md
@@ -185,9 +185,9 @@ Instructions for implementing each feature follow.
- Multi-line commands
- Any command accepts multi-line input when its name is listed in `Cmd.multiline_commands`.
- The program will keep expecting input until a line ends with any of the characters
- in `Cmd.terminators` . The default terminators are `;` and `/n` (empty newline).
+ Any command accepts multi-line input when its name is listed the `multiline_commands` optional argument to
+ `cmd2.Cmd.__init`. The program will keep expecting input until a line ends with any of the characters listed in the
+ `terminators` optional argument to `cmd2.Cmd.__init__()` . The default terminators are `;` and `/n` (empty newline).
- Special-character shortcut commands (beyond cmd's "@" and "!")
@@ -239,14 +239,13 @@ class CmdLineApp(cmd2.Cmd):
MUMBLE_LAST = ['right?']
def __init__(self):
- self.multiline_commands = ['orate']
self.maxrepeats = 3
# Add stuff to shortcuts before calling base class initializer
self.shortcuts.update({'&': 'speak'})
# Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
- super().__init__(use_ipython=False)
+ super().__init__(use_ipython=False, multiline_commands=['orate'])
# Make maxrepeats settable at runtime
self.settable['maxrepeats'] = 'max repetitions for speak command'