Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Removed unnecessary arguments in rich_text_to_string().
  • Loading branch information
kmvanbrunt committed Mar 3, 2026
commit b3d016ee8ea342f3cdf5b8880fa77c598e0bb491
4 changes: 2 additions & 2 deletions cmd2/argparse_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 0 additions & 3 deletions cmd2/rich_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading