mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-03 10:31:46 +00:00
print message and return 0 for list queries returning empty results
This commit is contained in:
parent
417ad54a0c
commit
23e358da9c
@ -50,10 +50,10 @@ def list_(
|
||||
]
|
||||
|
||||
if not groups:
|
||||
raise OBSWSCLIError(
|
||||
f'No groups found in scene {console.highlight(ctx, scene_name)}.',
|
||||
code=ExitCode.SUCCESS,
|
||||
console.out.print(
|
||||
f'No groups found in scene {console.highlight(ctx, scene_name)}.'
|
||||
)
|
||||
return
|
||||
|
||||
table = Table(
|
||||
title=f'Groups in Scene: {scene_name}',
|
||||
|
@ -74,7 +74,8 @@ def list_(
|
||||
)
|
||||
|
||||
if not inputs:
|
||||
raise OBSWSCLIError('No inputs found.', code=ExitCode.SUCCESS)
|
||||
console.out.print('No inputs found matching the specified filters.')
|
||||
return
|
||||
|
||||
table = Table(title='Inputs', padding=(0, 2), border_style=ctx.style.border)
|
||||
if uuid:
|
||||
|
@ -37,6 +37,10 @@ def list_(
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
|
||||
if not resp.profiles:
|
||||
console.out.print('No profiles found.')
|
||||
return
|
||||
|
||||
for profile in resp.profiles:
|
||||
table.add_row(
|
||||
profile,
|
||||
|
@ -38,6 +38,10 @@ def list_monitors(
|
||||
key=lambda m: m[0],
|
||||
)
|
||||
|
||||
if not monitors:
|
||||
console.out.print('No monitors available.')
|
||||
return
|
||||
|
||||
table = Table(
|
||||
title='Available Monitors',
|
||||
padding=(0, 2),
|
||||
|
@ -36,6 +36,10 @@ def list_(
|
||||
for scene in reversed(resp.scenes)
|
||||
)
|
||||
|
||||
if not scenes:
|
||||
console.out.print('No scenes found.')
|
||||
return
|
||||
|
||||
active_scene = ctx.client.get_current_program_scene().scene_name
|
||||
|
||||
table = Table(title='Scenes', padding=(0, 2), border_style=ctx.style.border)
|
||||
|
@ -37,6 +37,10 @@ def list_(
|
||||
)
|
||||
table.add_column('Scene Collection Name', justify='left', style=ctx.style.column)
|
||||
|
||||
if not resp.scene_collections:
|
||||
console.out.print('No scene collections found.')
|
||||
return
|
||||
|
||||
for scene_collection_name in resp.scene_collections:
|
||||
table.add_row(scene_collection_name)
|
||||
|
||||
|
@ -60,10 +60,10 @@ def list_(
|
||||
)
|
||||
|
||||
if not items:
|
||||
raise OBSWSCLIError(
|
||||
f'No items found in scene [yellow]{scene_name}[/yellow].',
|
||||
exit_code=ExitCode.SUCCESS,
|
||||
console.out.print(
|
||||
f'No items found in scene {console.highlight(ctx, scene_name)}.'
|
||||
)
|
||||
return
|
||||
|
||||
table = Table(
|
||||
title=f'Items in Scene: {scene_name}',
|
||||
|
Loading…
x
Reference in New Issue
Block a user