Setup arguments, workflow
This commit is contained in:
1 parent
933153950e
commit
d93ee140f7
4 files changed
+41
-4
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user