diff --git a/pyproject.toml b/pyproject.toml index b9ad38d..b642795 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,8 @@ version = "0.0.1" description = "Scan tickets and decide" requires-python = ">=3.12" dependencies = [ - "pillow==12.1.1" + "pillow==12.1.1", + "pydantic==2.12.5" ] [project.optional-dependencies] diff --git a/src/beaky/cli.py b/src/beaky/cli.py index 869533a..608a747 100644 --- a/src/beaky/cli.py +++ b/src/beaky/cli.py @@ -1,5 +1,25 @@ +import argparse +from pydantic import ValidationError + +from beaky.config import Config +from beaky.scanner.scanner import Scanner + + def main(): - print("Hi") + parser = argparse.ArgumentParser( + prog="beaky" + ) + parser.add_argument("path", help="Path to config file.") + args = parser.parse_args() + + try: + config = Config(**vars(args)) + except ValidationError as e: + print("Bad arguments") + print(e) + return + + Scanner(config) if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/src/beaky/config.py b/src/beaky/config.py new file mode 100644 index 0000000..f0e773b --- /dev/null +++ b/src/beaky/config.py @@ -0,0 +1,5 @@ +from pydantic.dataclasses import dataclass + +@dataclass +class Config: + path: str