Switch from option to arg

This commit is contained in:
Torjus Håkestad 2024-06-04 17:01:24 +02:00
parent 32ab2508c3
commit 1affe0fde2

View File

@ -107,10 +107,10 @@ app = typer.Typer()
@app.command() @app.command()
def set_color( def set_color(
id: Annotated[ id: Annotated[
LightID, typer.Option(help="ID of light.", autocompletion=complete_id) LightID, typer.Argument(help="ID of light.", autocompletion=complete_id)
], ],
color: Annotated[ color: Annotated[
str, typer.Option(help="Color to set", autocompletion=complete_color) str, typer.Argument(help="Color to set", autocompletion=complete_color)
], ],
): ):
""" """
@ -136,10 +136,10 @@ def set_color(
@app.command() @app.command()
def set_state( def set_state(
id: Annotated[ id: Annotated[
LightID, typer.Option(help="ID of light.", autocompletion=complete_id) LightID, typer.Argument(help="ID of light.", autocompletion=complete_id)
], ],
state: Annotated[ state: Annotated[
LightState, typer.Option(help="State of light.", autocompletion=complete_state) LightState, typer.Argument(help="State of light.", autocompletion=complete_state)
]): ]):
""" """
Set the state of ID to STATE Set the state of ID to STATE
@ -153,7 +153,7 @@ def set_state(
@app.command() @app.command()
def set_brightness( def set_brightness(
id: Annotated[ id: Annotated[
LightID, typer.Option(help="ID of light.", autocompletion=complete_id) LightID, typer.Argument(help="ID of light.", autocompletion=complete_id)
], ],
brightness: int): brightness: int):
""" """