-e "/_ =>/i\ \"$(subst new-,,$@)\" => $(subst new-,,$@)::run(\&input)?," \
src/main.rs
+# Requires a .cookie file
+# do not use leading 0
+# make input-1
+# make input-10
+input-%:
+ [ ! -f .cookie ] && echo "Missing .cookie file" && return 1 || true
+ curl -o input/day$$(printf "%02d" $(subst input-,,$@)).txt \
+ -H "Cookie: session=$$(cat .cookie)" \
+ "https://adventofcode.com/2024/day/$(subst input-,,$@)/input"
+
# run the tests for a specific day
test-day%:
cargo test $(subst test-,,$@)::tests -- --nocapture