Skip to content

Commit

Permalink
Merge pull request #64 from EchterAlsFake/packaging_cli
Browse files Browse the repository at this point in the history
- added direct CLI usage
  • Loading branch information
Egsagon authored Aug 27, 2024
2 parents 0f8a6a8 + 9ce10be commit b73c7f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ requires-python = ">=3.9"
[project.optional-dependencies]
cli = ["click"]

[project.scripts]
phub = "phub.__main__:main"

[project.urls]
Documentation = "https://phub.readthedocs.io"
Repository = "https://github.com/EchterAlsFake/PHUB"
Expand Down
9 changes: 8 additions & 1 deletion src/phub/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
PHUB built-in CLI.
'''
import os
import click
import phub

try:
import click

except (ModuleNotFoundError, ImportError):
print("The CLI needs 'click' in order to work. Please do: 'pip install click'")
exit()


@click.command()
@click.argument('input')
@click.option('--output', help = 'Output file or directory', default = './')
Expand Down

0 comments on commit b73c7f3

Please sign in to comment.