diff --git a/compose_viz/__main__.py b/compose_viz/__main__.py index 6f832b4..4065f3b 100644 --- a/compose_viz/__main__.py +++ b/compose_viz/__main__.py @@ -1,9 +1,5 @@ -from compose_viz import cli, __app_name__ - - -def main() -> None: - cli.app(prog_name=__app_name__) +from compose_viz.cli import start_cli if __name__ == "__main__": - main() + start_cli() diff --git a/compose_viz/cli.py b/compose_viz/cli.py index 2325329..d2bf1d3 100644 --- a/compose_viz/cli.py +++ b/compose_viz/cli.py @@ -55,3 +55,7 @@ def compose_viz( typer.echo(f"Successfully parsed {input_path}") raise typer.Exit() + + +def start_cli() -> None: + app(prog_name=__app_name__) diff --git a/pyproject.toml b/pyproject.toml index 44e45d3..6ae61bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,3 +15,6 @@ pytest = "^7.1.2" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +compose_viz = "compose_viz.cli:start_cli"