summaryrefslogtreecommitdiff
path: root/docs/features/initialization.rst
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-06 18:20:50 -0500
committerGitHub <noreply@github.com>2020-02-06 18:20:50 -0500
commitc7ac2e965d025806ce5baddfc718814e3e58d639 (patch)
tree6e046c2445edf62b024a9389dc719865584dc9cf /docs/features/initialization.rst
parent60a212c1c585f0c4c06ffcfeb9882520af8dbf35 (diff)
parentc4893ea8a132c06bc71b0ddd63801604e6f85177 (diff)
downloadcmd2-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/features/initialization.rst')
-rw-r--r--docs/features/initialization.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/features/initialization.rst b/docs/features/initialization.rst
index 46b4ecd2..d48290fa 100644
--- a/docs/features/initialization.rst
+++ b/docs/features/initialization.rst
@@ -20,7 +20,7 @@ capabilities which you may wish to utilize while initializing the app::
"""
import cmd2
from cmd2 import style
-
+ from cmd2.ansi import FG_COLORS
class BasicApp(cmd2.Cmd):
CUSTOM_CATEGORY = 'My Custom Commands'
@@ -48,7 +48,10 @@ capabilities which you may wish to utilize while initializing the app::
self.foreground_color = 'cyan'
# Make echo_fg settable at runtime
- self.settable['foreground_color'] = 'Foreground color to use with echo command'
+ self.add_settable(cmd2.Settable('foreground_color',
+ str,
+ 'Foreground color to use with echo command',
+ choices=FG_COLORS))
@cmd2.with_category(CUSTOM_CATEGORY)
def do_intro(self, _):