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
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-08-23 13:43:29 -0400
commitd464e2a7f625af607defca08c5f92fb530c6de3e (patch)
tree155a74f4d3b45dc9c8214871e9bf78df2e9a0ae9 /examples/custom_parser.py
parent548c97c516eea815471c0759f7b005ea836fea00 (diff)
downloadcmd2-git-custom_command_completer.tar.gz
Updated documentation for setting custom parserscustom_command_completer
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))