feat(cli): add --version flag to unmix CLI
This commit is contained in:
@ -22,6 +22,26 @@ app = typer.Typer(
|
|||||||
console = Console(stderr=True)
|
console = Console(stderr=True)
|
||||||
|
|
||||||
|
|
||||||
|
def version_callback(value: bool) -> None:
|
||||||
|
if value:
|
||||||
|
print(f"unmix v{__version__}")
|
||||||
|
raise typer.Exit()
|
||||||
|
|
||||||
|
|
||||||
|
@app.callback()
|
||||||
|
def main(
|
||||||
|
version: bool | None = typer.Option(
|
||||||
|
None,
|
||||||
|
"--version",
|
||||||
|
"-v",
|
||||||
|
help="Show version and exit.",
|
||||||
|
callback=version_callback,
|
||||||
|
is_eager=True,
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""Audio analysis pipeline decomposing songs into song packages."""
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def analyze(
|
def analyze(
|
||||||
file: Path = typer.Argument(..., help="Path to input audio or video file", exists=True, readable=True),
|
file: Path = typer.Argument(..., help="Path to input audio or video file", exists=True, readable=True),
|
||||||
|
|||||||
Reference in New Issue
Block a user