diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-29 15:47:23 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-29 15:47:23 -0400 |
commit | 31da70efe7160439eb6ab13f46739993f4d4cd7f (patch) | |
tree | 56f8437b29dabb91928ab52b25229346f002b62e /README.md | |
parent | 25552125316eabc119e39e4abc136ca0c79fb403 (diff) | |
download | cmd2-git-31da70efe7160439eb6ab13f46739993f4d4cd7f.tar.gz |
Added import of ansi.style directly into cmd2 namespace in __init__.py
Also:
- Fixed an example in README which was using print() instead of self.poutput()
Diffstat (limited to 'README.md')
-rwxr-xr-x | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -91,7 +91,7 @@ Instructions for implementing each feature follow. class MyApp(cmd2.Cmd): def do_foo(self, args): """This docstring is the built-in help for the foo command.""" - print(cmd2.ansi.style('foo bar baz', fg='red')) + self.poutput(cmd2.style('foo bar baz', fg='red')) ``` - By default the docstring for your **do_foo** method is the help for the **foo** command - NOTE: This doesn't apply if you use one of the `argparse` decorators mentioned below |