diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-02-04 23:01:30 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-02-04 23:01:30 -0500 |
commit | 40722f10ace3107dcb4709008239ac8233ada30f (patch) | |
tree | 676edd56ec5ba1287cd4f38b66f2733eea597ee9 /examples/initialization.py | |
parent | 61dfcf613966355d68c01f2aa06f0158b54c1f20 (diff) | |
download | cmd2-git-40722f10ace3107dcb4709008239ac8233ada30f.tar.gz |
Added cmd2.utils.Settable to the cmd2 namespace and updated examples and docs
Diffstat (limited to 'examples/initialization.py')
-rwxr-xr-x | examples/initialization.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/initialization.py b/examples/initialization.py index 32aa852f..c13ed137 100755 --- a/examples/initialization.py +++ b/examples/initialization.py @@ -14,6 +14,7 @@ """ import cmd2 from cmd2 import style +from cmd2.ansi import FG_COLORS class BasicApp(cmd2.Cmd): @@ -42,7 +43,8 @@ class BasicApp(cmd2.Cmd): 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, _): |