summaryrefslogtreecommitdiff
path: root/examples/custom_parser.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-08-23 13:43:29 -0400
committeranselor <anselor@gmail.com>2021-08-23 14:17:12 -0400
commit70846b510ded509666712460401c00550dfbdfcf (patch)
tree155a74f4d3b45dc9c8214871e9bf78df2e9a0ae9 /examples/custom_parser.py
parent0641c902df0778774768c55ddcca3a518f13e191 (diff)
downloadcmd2-git-70846b510ded509666712460401c00550dfbdfcf.tar.gz
Updated documentation for setting custom parsers
Diffstat (limited to 'examples/custom_parser.py')
-rw-r--r--examples/custom_parser.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/custom_parser.py b/examples/custom_parser.py
index 6df68bfa..ea66e7e1 100644
--- a/examples/custom_parser.py
+++ b/examples/custom_parser.py
@@ -31,6 +31,8 @@ class CustomParser(Cmd2ArgumentParser):
linum += 1
self.print_usage(sys.stderr)
+
+ # Format errors with style_warning()
formatted_message = ansi.style_warning(formatted_message)
self.exit(2, '{}\n\n'.format(formatted_message))