diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-02-06 18:20:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-06 18:20:50 -0500 |
commit | c7ac2e965d025806ce5baddfc718814e3e58d639 (patch) | |
tree | 6e046c2445edf62b024a9389dc719865584dc9cf /docs/examples | |
parent | 60a212c1c585f0c4c06ffcfeb9882520af8dbf35 (diff) | |
parent | c4893ea8a132c06bc71b0ddd63801604e6f85177 (diff) | |
download | cmd2-git-c7ac2e965d025806ce5baddfc718814e3e58d639.tar.gz |
Merge pull request #873 from python-cmd2/set_update
Updated set command to support tab completion of values
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 |