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/features/initialization.rst | |
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/features/initialization.rst')
-rw-r--r-- | docs/features/initialization.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/features/initialization.rst b/docs/features/initialization.rst index 9924caa2..5721caa3 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, _): |