leave it up to rich... if no style is set we still get colour on stderr, but this can be overriden with NO_COLOR manually

patch bump
This commit is contained in:
onyx-and-iris 2025-06-22 11:33:52 +01:00
parent d8622ab037
commit fe3a975ba3
2 changed files with 2 additions and 6 deletions

View File

@ -1,3 +1,3 @@
"""module for package metadata.""" """module for package metadata."""
__version__ = '0.11.1' __version__ = '0.11.2'

View File

@ -1,14 +1,10 @@
"""module for console output handling.""" """module for console output handling."""
import os
import asyncclick as click import asyncclick as click
from rich.console import Console from rich.console import Console
out = Console() out = Console()
err = Console( err = Console(stderr=True, style='bold red')
stderr=True, style='bold red' if os.getenv('NO_COLOR', '') != '' else 'none'
)
def highlight(ctx: click.Context, text: str) -> str: def highlight(ctx: click.Context, text: str) -> str: