diff options
author | kotfu <kotfu@kotfu.net> | 2020-02-06 16:39:43 -0700 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2020-02-06 16:39:43 -0700 |
commit | 87826cc7d2186cee0fbdf256756dcedb0d69e919 (patch) | |
tree | 1d4dfaa7d61606ea9cd531356ff334fc65b53b31 /docs/examples | |
parent | bf3dc169c047acda1c1cf505e8cd0e9e46d4b4cf (diff) | |
parent | c7ac2e965d025806ce5baddfc718814e3e58d639 (diff) | |
download | cmd2-git-87826cc7d2186cee0fbdf256756dcedb0d69e919.tar.gz |
Merge branch 'master' into doc_streamline
# Conflicts:
# docs/features/settings.rst
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/first_app.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/examples/first_app.rst b/docs/examples/first_app.rst index 19d573b4..310c8d0c 100644 --- a/docs/examples/first_app.rst +++ b/docs/examples/first_app.rst @@ -67,7 +67,7 @@ initializer to our class:: # Make maxrepeats settable at runtime self.maxrepeats = 3 - self.settable['maxrepeats'] = 'max repetitions for speak command' + self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command')) In that initializer, the first thing to do is to make sure we initialize ``cmd2``. That's what the ``super().__init__()`` line does. Then we create an @@ -203,7 +203,7 @@ method so it looks like this:: # Make maxrepeats settable at runtime self.maxrepeats = 3 - self.settable['maxrepeats'] = 'max repetitions for speak command' + self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command')) Shortcuts are passed to the ``cmd2`` initializer, and if you want the built-in shortcuts of ``cmd2`` you have to pass them. These shortcuts are defined as a |