Skip to content

Commit 81d5ad7

Browse files
committed
Updated docs
1 parent a84860e commit 81d5ad7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

docs/examples/first_app.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ initializer to our class::
6868

6969
# Make maxrepeats settable at runtime
7070
self.maxrepeats = 3
71-
self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command'))
71+
self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command', self))
7272

7373
In that initializer, the first thing to do is to make sure we initialize
7474
``cmd2``. That's what the ``super().__init__()`` line does. Next create an
@@ -204,7 +204,7 @@ method so it looks like this::
204204

205205
# Make maxrepeats settable at runtime
206206
self.maxrepeats = 3
207-
self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command'))
207+
self.add_settable(cmd2.Settable('maxrepeats', int, 'max repetitions for speak command', self))
208208

209209
Shortcuts are passed to the ``cmd2`` initializer, and if you want the built-in
210210
shortcuts of ``cmd2`` you have to pass them. These shortcuts are defined as a

docs/features/initialization.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ capabilities which you may wish to utilize while initializing the app::
5050
self.add_settable(cmd2.Settable('foreground_color',
5151
str,
5252
'Foreground color to use with echo command',
53+
self,
5354
choices=fg.colors()))
5455

5556
@cmd2.with_category(CUSTOM_CATEGORY)

docs/features/plugins.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ example::
8181
super().__init__(*args, **kwargs)
8282
# code placed here runs after cmd2.Cmd initializes
8383
self.mysetting = 'somevalue'
84-
self.add_settable(cmd2.Settable('mysetting', str, 'short help message for mysetting'))
84+
self.add_settable(cmd2.Settable('mysetting', str, 'short help message for mysetting', self))
8585

8686
You can hide settings from the user by calling
8787
:meth:`~cmd2.Cmd.remove_settable`. See :ref:`features/settings:Settings` for

0 commit comments

Comments
 (0)