Skip to content

Commit 71d6846

Browse files
committed
feat: add cli entrypoint
1 parent 0317054 commit 71d6846

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

pytemplate/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
"""Init file."""
1+
"""Init file.
2+
3+
Called when you import pytemplate.
4+
"""
25

36
from pytemplate.main import main # noqa

pytemplate/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Entry point of the CLI version.
2+
3+
Called from poetry.
4+
"""
5+
6+
from .main import main
7+
8+
if __name__ == '__main__':
9+
main()

pytemplate/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
"""Main."""
1+
"""Main.
2+
3+
You can directly import the main function in your code.
4+
"""
25

36

47
def main() -> None:

0 commit comments

Comments
 (0)