This commit is contained in:
dingfeng.wong
2025-07-22 01:20:14 +08:00
parent 5f0d1d63de
commit 20adfed935
2 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ dependencies = [
]
[project.scripts]
ocr-screenshot = "tooling.cli:main"
ocr-screenshot = "tooling.cli:cli_main"
[build-system]
requires = ["hatchling"]
+9 -8
View File
@@ -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()