From b3d016ee8ea342f3cdf5b8880fa77c598e0bb491 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 3 Mar 2026 03:21:20 -0500 Subject: [PATCH] Removed unnecessary arguments in rich_text_to_string(). --- cmd2/argparse_custom.py | 4 ++-- cmd2/rich_utils.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index c74388b0c..bfcdf3871 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 4178158d6..418783281 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: