diff --git a/pyproject.toml b/pyproject.toml index 6e3c32f..e7cc587 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,5 +18,8 @@ homepage = "https://github.com/skorokithakis/shortuuid/" authors = ["Stavros Korokithakis "] readme = "README.md" +[tool.poetry.scripts] +shortuuid = "shortuuid:cli.main" + [tool.poetry.dependencies] python = ">=3.5" diff --git a/shortuuid/__main__.py b/shortuuid/cli.py similarity index 60% rename from shortuuid/__main__.py rename to shortuuid/cli.py index 23cf45c..166f676 100644 --- a/shortuuid/__main__.py +++ b/shortuuid/cli.py @@ -1,4 +1,5 @@ from .main import uuid -if __name__ == "__main__": + +def main(): print(uuid())