diff --git a/src/unmix/cli.py b/src/unmix/cli.py index 327bf00..bc9bc45 100644 --- a/src/unmix/cli.py +++ b/src/unmix/cli.py @@ -22,6 +22,26 @@ app = typer.Typer( 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() def analyze( file: Path = typer.Argument(..., help="Path to input audio or video file", exists=True, readable=True),