argparse working
This commit is contained in:
parent
89a3c08a50
commit
3492294335
5 changed files with 1057 additions and 0 deletions
33
aoc.py
Executable file
33
aoc.py
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
|
||||
|
||||
def argparser(*args, **kwargs):
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="python aoc.py",
|
||||
description="Streamlined Advent of Code",
|
||||
epilog="We have to save christmas!",
|
||||
argument_default=None,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-y",
|
||||
"--years",
|
||||
nargs="1",
|
||||
dest="years",
|
||||
default="2024",
|
||||
help="set what years to solve problems from",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--days",
|
||||
nargs="1",
|
||||
dest="days",
|
||||
default="1",
|
||||
help="set what days to solve",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = argparser()
|
Loading…
Add table
Add a link
Reference in a new issue