From d93ee140f75afc3c986651393371b72a385f3c31 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 30 Jun 2026 16:31:31 -0400 Subject: [PATCH] Setup arguments, workflow --- .idea/misc.xml | 3 +++ main.py | 23 ++++++++++++++++++++--- pyproject.toml | 4 +++- uv.lock | 15 +++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 3570188..590a59e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/main.py b/main.py index ce8833a..5ebf6a3 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,23 @@ -def main(): - print("Hello from pyaoc!") +import argparse + +def main(day: int, test: bool = False) -> str: + print("Called main...") + print("Day is: {}".format(day)) + print("Testing: {}".format(test)) if __name__ == "__main__": - main() + parser = argparse.ArgumentParser( + description='Advent of Code Event 2015 Python solutions' + ) + parser.add_argument("-t", "--test", action="store_true") + parser.add_argument( + "-d", + "--day", + type=int, + choices=range(1, 25), + help="Integer day number to solve for (1-25)." + ) + args = parser.parse_args() + + main(day=args.day, test=args.test) diff --git a/pyproject.toml b/pyproject.toml index d71a712..775543a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,4 +4,6 @@ version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.14" -dependencies = [] +dependencies = [ + "argparse>=1.4.0", +] diff --git a/uv.lock b/uv.lock index 2ff9a81..5a2f8a8 100644 --- a/uv.lock +++ b/uv.lock @@ -2,7 +2,22 @@ version = 1 revision = 3 requires-python = ">=3.14" +[[package]] +name = "argparse" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/18/dd/e617cfc3f6210ae183374cd9f6a26b20514bbb5a792af97949c5aacddf0f/argparse-1.4.0.tar.gz", hash = "sha256:62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4", size = 70508, upload-time = "2015-09-12T20:22:16.217Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl", hash = "sha256:c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314", size = 23000, upload-time = "2015-09-14T16:03:16.137Z" }, +] + [[package]] name = "pyaoc" version = "0.1.0" source = { virtual = "." } +dependencies = [ + { name = "argparse" }, +] + +[package.metadata] +requires-dist = [{ name = "argparse", specifier = ">=1.4.0" }]