mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 20:20:32 +01:00
print hotkey list as rich table
patch bump
This commit is contained in:
parent
995500b971
commit
94d6c32c31
@ -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"
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user