diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de3653..3644a17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 1.8.5 (2024-12-01) + +- Fix issue with error messages not using user-defined styles. [[#215](https://github.com/ewels/rich-click/pull/215)] ([@sankarngrjn](https://github.com/sankarngrjn)) + ## Version 1.8.4 (2024-11-12) - Support `rich.text.Text()` objects for `header_text`, `footer_text`, `errors_suggestion`, and `errors_epilogue`. diff --git a/src/rich_click/__init__.py b/src/rich_click/__init__.py index 5d68e2b..251971d 100644 --- a/src/rich_click/__init__.py +++ b/src/rich_click/__init__.py @@ -6,7 +6,7 @@ customisation required. """ -__version__ = "1.8.4" +__version__ = "1.8.5" # Import the entire click API here. # We need to manually import these instead of `from click import *` to force diff --git a/src/rich_click/rich_command.py b/src/rich_click/rich_command.py index a3f9d3e..a870376 100644 --- a/src/rich_click/rich_command.py +++ b/src/rich_click/rich_command.py @@ -167,10 +167,10 @@ def main( if not standalone_mode: raise if ctx is not None: - config = ctx.help_config + formatter = ctx.make_formatter() else: config = self._generate_rich_help_config() - formatter = self.context_class.formatter_class(config=config, file=sys.stderr) + formatter = self.context_class.formatter_class(console=self.console, config=config, file=sys.stderr) from rich_click.rich_help_rendering import rich_format_error rich_format_error(e, formatter) @@ -192,10 +192,10 @@ def main( raise try: if ctx is not None: - config = ctx.help_config + formatter = ctx.make_formatter() else: config = self._generate_rich_help_config() - formatter = self.context_class.formatter_class(config=config) + formatter = self.context_class.formatter_class(console=self.console, config=config) except Exception: click.echo("Aborted!", file=sys.stderr) else: