diff --git a/obsws_cli/hotkey.py b/obsws_cli/hotkey.py index 5a996e7..57c6591 100644 --- a/obsws_cli/hotkey.py +++ b/obsws_cli/hotkey.py @@ -24,6 +24,10 @@ def list_( """List all hotkeys.""" resp = ctx.obj['obsws'].get_hotkey_list() + if not resp.hotkeys: + console.out.print('No hotkeys found.') + raise typer.Exit() + table = Table( title='Hotkeys', padding=(0, 2), diff --git a/obsws_cli/profile.py b/obsws_cli/profile.py index 81ec825..a856c58 100644 --- a/obsws_cli/profile.py +++ b/obsws_cli/profile.py @@ -22,6 +22,10 @@ def list_(ctx: typer.Context): """List profiles.""" resp = ctx.obj['obsws'].get_profile_list() + if not resp.profiles: + console.out.print('No profiles found.') + raise typer.Exit() + table = Table( title='Profiles', padding=(0, 2), border_style=ctx.obj['style'].border ) diff --git a/obsws_cli/projector.py b/obsws_cli/projector.py index d2a2968..9eecd53 100644 --- a/obsws_cli/projector.py +++ b/obsws_cli/projector.py @@ -21,16 +21,15 @@ def main(): def list_monitors(ctx: typer.Context): """List available monitors.""" resp = ctx.obj['obsws'].get_monitor_list() - - if not resp.monitors: - console.out.print('No monitors found.') - return - monitors = sorted( ((m['monitorIndex'], m['monitorName']) for m in resp.monitors), key=lambda m: m[0], ) + if not monitors: + console.out.print('No monitors found.') + raise typer.Exit() + table = Table( title='Available Monitors', padding=(0, 2), diff --git a/obsws_cli/scene.py b/obsws_cli/scene.py index f52ced6..850168e 100644 --- a/obsws_cli/scene.py +++ b/obsws_cli/scene.py @@ -29,6 +29,10 @@ def list_( for scene in reversed(resp.scenes) ) + if not scenes: + console.out.print('No scenes found.') + raise typer.Exit() + active_scene = ctx.obj['obsws'].get_current_program_scene().scene_name table = Table(title='Scenes', padding=(0, 2), border_style=ctx.obj['style'].border) diff --git a/obsws_cli/scenecollection.py b/obsws_cli/scenecollection.py index 6c1bcd0..4680b16 100644 --- a/obsws_cli/scenecollection.py +++ b/obsws_cli/scenecollection.py @@ -21,6 +21,10 @@ def list_(ctx: typer.Context): """List all scene collections.""" resp = ctx.obj['obsws'].get_scene_collection_list() + if not resp.scene_collections: + console.out.print('No scene collections found.') + raise typer.Exit() + table = Table( title='Scene Collections', padding=(0, 2),