mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-27 14:00:30 +01:00
pass context to check_mark so we can do the same there. Fixes rich.errors.MarkupError
15 lines
426 B
Python
15 lines
426 B
Python
"""module for console output handling in obsws_cli."""
|
|
|
|
import typer
|
|
from rich.console import Console
|
|
|
|
out = Console()
|
|
err = Console(stderr=True, style='bold red')
|
|
|
|
|
|
def highlight(ctx: typer.Context, text: str) -> str:
|
|
"""Highlight text using the current context's style."""
|
|
if ctx.obj['style'].name == 'no_colour':
|
|
return text
|
|
return f'[{ctx.obj["style"].highlight}]{text}[/{ctx.obj["style"].highlight}]'
|