print hotkey list as rich table

patch bump
This commit is contained in:
onyx-and-iris 2025-05-23 22:28:43 +01:00
parent 995500b971
commit 94d6c32c31
2 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
#
# SPDX-License-Identifier: MIT
__version__ = "0.12.2"
__version__ = "0.12.3"

View File

@ -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')