From 5cdbf60745eb57a6fa7da71f17c50245f943efdd Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sun, 11 Dec 2022 23:39:47 -0500 Subject: [PATCH] Add ability to just download input --- download.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/download.py b/download.py index 10182d5..14406ed 100644 --- a/download.py +++ b/download.py @@ -198,6 +198,7 @@ class FetchCommand(click.Command): 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("--inputonly", "input_only", is_flag=True, help="Don't attempt to fetch sample inputs") @click.option("--year", type=int) @click.option("--day", type=int) def main( @@ -206,6 +207,7 @@ def main( token_path: pathlib.Path, output_dir: pathlib.Path, wait: bool, + input_only: bool, day: Optional[int], year: Optional[int], ): @@ -230,8 +232,9 @@ def main( date_to_fetch = specified_date or PuzzleDate.get_latest() step = None try: - step = "download sample inputs" - download_sample_inputs(date_to_fetch, output_dir) + if not input_only: + step = "download sample inputs" + download_sample_inputs(date_to_fetch, output_dir) step = "download input" download_input(date_to_fetch, token, output_dir) except requests.exceptions.HTTPError as err: