mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-18 15:03:44 +00:00
we lose aliases in the help output but this does fix shell completion, which is more important.
fixes #3
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user