we lose aliases in the help output but this does fix shell completion, which is more important.

fixes #3
This commit is contained in:
2026-02-07 05:20:37 +00:00
parent 34067ca61d
commit 9693d4f913
19 changed files with 180 additions and 141 deletions

View File

@@ -3,9 +3,8 @@
import typer
from obsws_cli import console
from obsws_cli.alias import SubTyperAliasGroup
app = typer.Typer(cls=SubTyperAliasGroup)
app = typer.Typer()
@app.callback()
@@ -13,21 +12,24 @@ def main():
"""Control studio mode in OBS."""
@app.command('enable | on')
@app.command('enable')
@app.command('on', hidden=True)
def enable(ctx: typer.Context):
"""Enable studio mode."""
ctx.obj['obsws'].set_studio_mode_enabled(True)
console.out.print('Studio mode has been enabled.')
@app.command('disable | off')
@app.command('disable')
@app.command('off', hidden=True)
def disable(ctx: typer.Context):
"""Disable studio mode."""
ctx.obj['obsws'].set_studio_mode_enabled(False)
console.out.print('Studio mode has been disabled.')
@app.command('toggle | tg')
@app.command('toggle')
@app.command('tg', hidden=True)
def toggle(ctx: typer.Context):
"""Toggle studio mode."""
resp = ctx.obj['obsws'].get_studio_mode_enabled()
@@ -39,7 +41,8 @@ def toggle(ctx: typer.Context):
console.out.print('Studio mode is now enabled.')
@app.command('status | ss')
@app.command('status')
@app.command('ss', hidden=True)
def status(ctx: typer.Context):
"""Get the status of studio mode."""
resp = ctx.obj['obsws'].get_studio_mode_enabled()