a
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
ocr-screenshot = "tooling.cli:main"
|
||||
ocr-screenshot = "tooling.cli:cli_main"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
|
||||
+9
-8
@@ -32,23 +32,19 @@ console = Console()
|
||||
@app.command()
|
||||
def main(
|
||||
lang: str = typer.Option(
|
||||
"eng",
|
||||
"--lang",
|
||||
default="eng",
|
||||
help="Language code for OCR (default: eng)"
|
||||
),
|
||||
save_image: bool = typer.Option(
|
||||
False,
|
||||
"--save-image",
|
||||
default=False,
|
||||
help="Save the screenshot image instead of deleting it"
|
||||
),
|
||||
output_dir: Path = typer.Option(
|
||||
Path.home() / "Desktop",
|
||||
"--output-dir",
|
||||
default=Path.home() / "Desktop",
|
||||
help="Directory to save screenshot if --save-image is used (default: ~/Desktop)"
|
||||
),
|
||||
verbose: bool = typer.Option(
|
||||
False,
|
||||
"--verbose", "-v",
|
||||
default=False,
|
||||
help="Show verbose output"
|
||||
)
|
||||
):
|
||||
@@ -145,5 +141,10 @@ def main(
|
||||
pass # Ignore cleanup errors
|
||||
|
||||
|
||||
def cli_main():
|
||||
"""Entry point for the CLI script."""
|
||||
app()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
Reference in New Issue
Block a user