mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-18 06:53:38 +00:00
add --style validation
add Disabled class to style registry patch bump
This commit is contained in:
@@ -50,6 +50,15 @@ def setup_logging(debug: bool):
|
||||
)
|
||||
|
||||
|
||||
def validate_style(value: str):
|
||||
"""Validate and return the style."""
|
||||
if value not in styles.registry:
|
||||
raise typer.BadParameter(
|
||||
f'Invalid style: {value}. Available styles: {", ".join(styles.registry.keys())}'
|
||||
)
|
||||
return value
|
||||
|
||||
|
||||
@app.callback()
|
||||
def main(
|
||||
ctx: typer.Context,
|
||||
@@ -112,6 +121,7 @@ def main(
|
||||
envvar='OBS_STYLE',
|
||||
help='Set the style for the CLI output',
|
||||
show_default='disabled',
|
||||
callback=validate_style,
|
||||
),
|
||||
] = settings.get('style'),
|
||||
no_border: Annotated[
|
||||
|
||||
Reference in New Issue
Block a user