summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-13 17:54:47 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-13 17:54:47 -0400
commit258ad43a8fedd37d4aca5c3694e20a052b88ffbe (patch)
tree1072dca2cacb44239799869d8917fcca1b44f16a /cmd2/cmd2.py
parent677e8bb845ecee0bc58035095fc599ffb074c00f (diff)
downloadcmd2-git-258ad43a8fedd37d4aca5c3694e20a052b88ffbe.tar.gz
Writing to stderr in default() and _report_disabled_command_usage() to make it easy to detect an error in pyscript
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index e32b3180..37fed5a6 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2054,7 +2054,8 @@ class Cmd(cmd.Cmd):
return self.do_shell(statement.command_and_args)
else:
- self.poutput('*** {} is not a recognized command, alias, or macro\n'.format(statement.command))
+ self.perror('*** {} is not a recognized command, alias, or macro'.format(statement.command),
+ err_color=Fore.RESET, traceback_war=False)
def pseudo_raw_input(self, prompt: str) -> str:
"""Began life as a copy of cmd's cmdloop; like raw_input but
@@ -3706,7 +3707,7 @@ class Cmd(cmd.Cmd):
:param message_to_print: the message reporting that the command is disabled
:param kwargs: not used
"""
- self.poutput(message_to_print)
+ self.perror(message_to_print, err_color=Fore.RESET, traceback_war=False)
def cmdloop(self, intro: Optional[str] = None) -> None:
"""This is an outer wrapper around _cmdloop() which deals with extra features provided by cmd2.