diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-14 21:26:21 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-14 21:26:21 -0400 |
commit | 8cf0b30af678717160a6c53cc7c0c84aa007c42f (patch) | |
tree | 3f15fdd56bc2c740118c8b148d60c745af5b529f /docs/settingchanges.rst | |
parent | cfcff77bf47910e4c5aaaad8fa33f181281f94ee (diff) | |
download | cmd2-git-8cf0b30af678717160a6c53cc7c0c84aa007c42f.tar.gz |
Updated docs to reflect that shortcuts are now passed into the super class initializer
Diffstat (limited to 'docs/settingchanges.rst')
-rw-r--r-- | docs/settingchanges.rst | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst index c9345bc6..b9ad4a22 100644 --- a/docs/settingchanges.rst +++ b/docs/settingchanges.rst @@ -33,11 +33,9 @@ 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:: |