diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-18 22:49:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-18 22:49:42 -0400 |
| commit | 2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4 (patch) | |
| tree | b836270cf61175d1e4a434fd8cae08f0ffd998a2 /docs | |
| parent | 96d176cc3d8198913693a42c7dd983cf69a165bd (diff) | |
| parent | 57dd827963491439e40eb5dfe20811c14ea757ff (diff) | |
| download | cmd2-git-2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4.tar.gz | |
Merge branch 'master' into load_generate_transcript
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/settingchanges.rst | 10 | ||||
| -rw-r--r-- | docs/unfreefeatures.rst | 5 |
2 files changed, 6 insertions, 9 deletions
diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst index e1c437e4..b9ad4a22 100644 --- a/docs/settingchanges.rst +++ b/docs/settingchanges.rst @@ -33,18 +33,16 @@ To define more shortcuts, update the dict ``App.shortcuts`` with the class App(Cmd2): def __init__(self): - # Make sure you update the shortcuts attribute before calling the super class __init__ - self.shortcuts.update({'*': 'sneeze', '~': 'squirm'}) - - # Make sure to call this super class __init__ after updating shortcuts - cmd2.Cmd.__init__(self) + shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts.update({'*': 'sneeze', '~': 'squirm'}) + cmd2.Cmd.__init__(self, shortcuts=shortcuts) .. warning:: Shortcuts need to be created by updating the ``shortcuts`` dictionary attribute prior to calling the ``cmd2.Cmd`` super class ``__init__()`` method. Moreover, that super class init method needs to be called after updating the ``shortcuts`` attribute This warning applies in general to many other attributes which are not - settable at runtime such as ``multiline_commands``, etc. + settable at runtime. Aliases diff --git a/docs/unfreefeatures.rst b/docs/unfreefeatures.rst index 97953215..071a15b2 100644 --- a/docs/unfreefeatures.rst +++ b/docs/unfreefeatures.rst @@ -7,12 +7,11 @@ Multiline commands Command input may span multiple lines for the commands whose names are listed in the -parameter ``app.multiline_commands``. These +``multiline_commands`` argument to ``cmd2.Cmd.__init__()``. These commands will be executed only after the user has entered a *terminator*. By default, the command terminator is -``;``; replacing or appending to the list -``app.terminators`` allows different +``;``; specifying the ``terminators`` optional argument to ``cmd2.Cmd.__init__()`` allows different terminators. A blank line is *always* considered a command terminator (cannot be overridden). |
