From 31da70efe7160439eb6ab13f46739993f4d4cd7f Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sat, 29 Jun 2019 15:47:23 -0400 Subject: 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() --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7ac7eaea..451a7bf0 100755 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.1