add highlight helper function

This commit is contained in:
onyx-and-iris 2025-06-21 23:39:13 +01:00
parent a1ed208bdf
commit fb17979cb0

View File

@ -1,6 +1,12 @@
"""module for console output handling in obsws_cli.""" """module for console output handling in obsws_cli."""
import typer
from rich.console import Console from rich.console import Console
out = Console() out = Console()
err = Console(stderr=True, style='bold red') err = Console(stderr=True, style='bold red')
def highlight(ctx: typer.Context, text: str) -> str:
"""Highlight text using the current context's style."""
return f'[{ctx.obj["style"].highlight}]{text}[/{ctx.obj["style"].highlight}]'