From 94d6c32c31f75dc818f4c3857489339cfcb3af64 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 23 May 2025 22:28:43 +0100 Subject: [PATCH] print hotkey list as rich table patch bump --- obsws_cli/__about__.py | 2 +- obsws_cli/hotkey.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/obsws_cli/__about__.py b/obsws_cli/__about__.py index c26db80..6f92465 100644 --- a/obsws_cli/__about__.py +++ b/obsws_cli/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2025-present onyx-and-iris # # SPDX-License-Identifier: MIT -__version__ = "0.12.2" +__version__ = "0.12.3" diff --git a/obsws_cli/hotkey.py b/obsws_cli/hotkey.py index 2877713..5dabef7 100644 --- a/obsws_cli/hotkey.py +++ b/obsws_cli/hotkey.py @@ -1,10 +1,14 @@ """module containing commands for hotkey management.""" import typer +from rich.console import Console +from rich.table import Table from .alias import AliasGroup app = typer.Typer(cls=AliasGroup) +out_console = Console() +err_console = Console(stderr=True) @app.callback() @@ -18,7 +22,14 @@ def list( ): """List all hotkeys.""" resp = ctx.obj.get_hotkey_list() - typer.echo('\n'.join(resp.hotkeys)) + + table = Table(title='Hotkeys') + table.add_column('Name', justify='left', style='cyan') + + for hotkey in resp.hotkeys: + table.add_row(hotkey) + + out_console.print(table) @app.command('trigger | tr')