mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 20:20:32 +01:00
wrap annotations with Annotated
This commit is contained in:
parent
2d351e00b5
commit
59f52417cd
@ -1,5 +1,7 @@
|
|||||||
"""module containing commands for manipulating profiles in OBS."""
|
"""module containing commands for manipulating profiles in OBS."""
|
||||||
|
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
import typer
|
import typer
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
@ -47,7 +49,12 @@ def current(ctx: typer.Context):
|
|||||||
|
|
||||||
|
|
||||||
@app.command('switch | set')
|
@app.command('switch | set')
|
||||||
def switch(ctx: typer.Context, profile_name: str):
|
def switch(
|
||||||
|
ctx: typer.Context,
|
||||||
|
profile_name: Annotated[
|
||||||
|
str, typer.Argument(..., help='Name of the profile to switch to')
|
||||||
|
],
|
||||||
|
):
|
||||||
"""Switch to a profile."""
|
"""Switch to a profile."""
|
||||||
if not validate.profile_exists(ctx, profile_name):
|
if not validate.profile_exists(ctx, profile_name):
|
||||||
err_console.print(f"Profile '{profile_name}' not found.")
|
err_console.print(f"Profile '{profile_name}' not found.")
|
||||||
@ -63,7 +70,12 @@ def switch(ctx: typer.Context, profile_name: str):
|
|||||||
|
|
||||||
|
|
||||||
@app.command('create | new')
|
@app.command('create | new')
|
||||||
def create(ctx: typer.Context, profile_name: str):
|
def create(
|
||||||
|
ctx: typer.Context,
|
||||||
|
profile_name: Annotated[
|
||||||
|
str, typer.Argument(..., help='Name of the profile to create.')
|
||||||
|
],
|
||||||
|
):
|
||||||
"""Create a new profile."""
|
"""Create a new profile."""
|
||||||
if validate.profile_exists(ctx, profile_name):
|
if validate.profile_exists(ctx, profile_name):
|
||||||
err_console.print(f"Profile '{profile_name}' already exists.")
|
err_console.print(f"Profile '{profile_name}' already exists.")
|
||||||
@ -74,7 +86,12 @@ def create(ctx: typer.Context, profile_name: str):
|
|||||||
|
|
||||||
|
|
||||||
@app.command('remove | rm')
|
@app.command('remove | rm')
|
||||||
def remove(ctx: typer.Context, profile_name: str):
|
def remove(
|
||||||
|
ctx: typer.Context,
|
||||||
|
profile_name: Annotated[
|
||||||
|
str, typer.Argument(..., help='Name of the profile to remove.')
|
||||||
|
],
|
||||||
|
):
|
||||||
"""Remove a profile."""
|
"""Remove a profile."""
|
||||||
if not validate.profile_exists(ctx, profile_name):
|
if not validate.profile_exists(ctx, profile_name):
|
||||||
err_console.print(f"Profile '{profile_name}' not found.")
|
err_console.print(f"Profile '{profile_name}' not found.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user