From 5c84286d9edac35766e20fd32bdefef25318b27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Sat, 29 Oct 2022 14:36:26 +0200 Subject: [PATCH] feat: add `-y`flag alias for download command --- README.md | 2 +- src/bin/download.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 573fdbe..ab81c02 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ cargo download # 🎄 Successfully wrote input to "src/inputs/01.txt"! ``` -To download inputs for previous years, append the `--year` flag. _(example: `cargo download 1 --year 2020`)_ +To download inputs for previous years, append the `--year/-y` flag. _(example: `cargo download 1 --year 2020`)_ Puzzle inputs are not checked into git. [Reasoning](https://old.reddit.com/r/adventofcode/comments/k99rod/sharing_input_data_were_we_requested_not_to/gf2ukkf/?context=3). diff --git a/src/bin/download.rs b/src/bin/download.rs index 8c09679..f10aab3 100644 --- a/src/bin/download.rs +++ b/src/bin/download.rs @@ -12,7 +12,7 @@ fn parse_args() -> Result { let mut args = pico_args::Arguments::from_env(); Ok(Args { day: args.free_from_str()?, - year: args.opt_value_from_str("--year")?, + year: args.opt_value_from_str(["-y", "--year"])?, }) }