Add ability to just download input
parent
2858395e48
commit
5cdbf60745
|
@ -198,6 +198,7 @@ class FetchCommand(click.Command):
|
||||||
help="The location of the advent of code session token. Ignored if --token is provided.",
|
help="The location of the advent of code session token. Ignored if --token is provided.",
|
||||||
)
|
)
|
||||||
@click.option("--wait", is_flag=True, help="Wait until new puzzle inputs are ready")
|
@click.option("--wait", is_flag=True, help="Wait until new puzzle inputs are ready")
|
||||||
|
@click.option("--inputonly", "input_only", is_flag=True, help="Don't attempt to fetch sample inputs")
|
||||||
@click.option("--year", type=int)
|
@click.option("--year", type=int)
|
||||||
@click.option("--day", type=int)
|
@click.option("--day", type=int)
|
||||||
def main(
|
def main(
|
||||||
|
@ -206,6 +207,7 @@ def main(
|
||||||
token_path: pathlib.Path,
|
token_path: pathlib.Path,
|
||||||
output_dir: pathlib.Path,
|
output_dir: pathlib.Path,
|
||||||
wait: bool,
|
wait: bool,
|
||||||
|
input_only: bool,
|
||||||
day: Optional[int],
|
day: Optional[int],
|
||||||
year: Optional[int],
|
year: Optional[int],
|
||||||
):
|
):
|
||||||
|
@ -230,8 +232,9 @@ def main(
|
||||||
date_to_fetch = specified_date or PuzzleDate.get_latest()
|
date_to_fetch = specified_date or PuzzleDate.get_latest()
|
||||||
step = None
|
step = None
|
||||||
try:
|
try:
|
||||||
step = "download sample inputs"
|
if not input_only:
|
||||||
download_sample_inputs(date_to_fetch, output_dir)
|
step = "download sample inputs"
|
||||||
|
download_sample_inputs(date_to_fetch, output_dir)
|
||||||
step = "download input"
|
step = "download input"
|
||||||
download_input(date_to_fetch, token, output_dir)
|
download_input(date_to_fetch, token, output_dir)
|
||||||
except requests.exceptions.HTTPError as err:
|
except requests.exceptions.HTTPError as err:
|
||||||
|
|
Loading…
Reference in New Issue