Skip to content

Commit

Permalink
fix: Fix the cli interface that the previous release broke
Browse files Browse the repository at this point in the history
  • Loading branch information
skorokithakis committed Nov 8, 2021
1 parent 349fef6 commit acc3501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ homepage = "https://github.com/skorokithakis/shortuuid/"
authors = ["Stavros Korokithakis <[email protected]>"]
readme = "README.md"

[tool.poetry.scripts]
shortuuid = "shortuuid:cli.main"

[tool.poetry.dependencies]
python = ">=3.5"
3 changes: 2 additions & 1 deletion shortuuid/__main__.py → shortuuid/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .main import uuid

if __name__ == "__main__":

def main():
print(uuid())

4 comments on commit acc3501

@merwok
Copy link
Contributor

@merwok merwok commented on acc3501 Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found this — it adds a shortuuid script but breaks python -m shortuuid

@skorokithakis
Copy link
Owner Author

@skorokithakis skorokithakis commented on acc3501 Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merwok Hmm, can you use the script instead? python -m shortuuid was never an official way to run ShortUUID.

@merwok
Copy link
Contributor

@merwok merwok commented on acc3501 Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did add it in #43 and was using it :)

But shortuuid as a script is shorter and available when shortuuid is installed, so that works too!
(I think I wrote my comment too tired and somehow thought this meant I could not make short UUIDs on the command-line anymore)

@skorokithakis
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, you still can! I'd rather support only one way to do that, and calling it directly seems better UX.

Please sign in to comment.