diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index c74388b0..bfcdf387 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -1361,10 +1361,10 @@ def error(self, message: str) -> NoReturn: self.print_usage(sys.stderr) - # Add error style to message + # Use console to add style since it will respect ALLOW_STYLE's value console = self._get_formatter().console with console.capture() as capture: - console.print(formatted_message, style=Cmd2Style.ERROR, crop=False) + console.print(formatted_message, style=Cmd2Style.ERROR) formatted_message = f"{capture.get()}" self.exit(2, f'{formatted_message}\n') diff --git a/cmd2/rich_utils.py b/cmd2/rich_utils.py index 4178158d..41878328 100644 --- a/cmd2/rich_utils.py +++ b/cmd2/rich_utils.py @@ -273,9 +273,6 @@ def rich_text_to_string(text: Text) -> str: force_terminal=True, soft_wrap=True, no_color=False, - markup=False, - emoji=False, - highlight=False, theme=APP_THEME, ) with console.capture() as capture: