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