mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-27 22:10:29 +01:00
add empty_if_false to check_mark
patch bump
This commit is contained in:
parent
fd2e629ec2
commit
c4480895a1
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = "0.17.3"
|
||||
__version__ = "0.17.4"
|
||||
|
@ -32,7 +32,7 @@ def list_(ctx: typer.Context):
|
||||
for profile in resp.profiles:
|
||||
table.add_row(
|
||||
profile,
|
||||
util.check_mark(profile == resp.current_profile_name),
|
||||
util.check_mark(profile == resp.current_profile_name, empty_if_false=True),
|
||||
)
|
||||
|
||||
console.out.print(table)
|
||||
|
@ -55,13 +55,13 @@ def list_(
|
||||
if uuid:
|
||||
table.add_row(
|
||||
scene_output,
|
||||
util.check_mark(scene_name == active_scene),
|
||||
util.check_mark(scene_name == active_scene, empty_if_false=True),
|
||||
scene_uuid,
|
||||
)
|
||||
else:
|
||||
table.add_row(
|
||||
scene_output,
|
||||
util.check_mark(scene_name == active_scene),
|
||||
util.check_mark(scene_name == active_scene, empty_if_false=True),
|
||||
)
|
||||
|
||||
console.out.print(table)
|
||||
|
@ -8,8 +8,11 @@ def snakecase_to_titlecase(snake_str: str) -> str:
|
||||
return snake_str.replace('_', ' ').title()
|
||||
|
||||
|
||||
def check_mark(value: bool) -> str:
|
||||
def check_mark(value: bool, empty_if_false: bool = False) -> str:
|
||||
"""Return a check mark or cross mark based on the boolean value."""
|
||||
if empty_if_false and not value:
|
||||
return ''
|
||||
|
||||
if os.getenv('NO_COLOR') is not None:
|
||||
return '✓' if value else '✗'
|
||||
return '✅' if value else '❌'
|
||||
|
Loading…
x
Reference in New Issue
Block a user