diff --git a/src/main.rs b/src/main.rs index 98c636e..c64067c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,11 @@ enum Subcommands { day: u8, /// The part to solve for part: u8 + }, + /// Fetches and prints the given input for a specified day + Input { + /// The day to fetch + day: u8 } } @@ -53,5 +58,20 @@ async fn main() { _ => panic!("Invalid day or part #") } }, + Subcommands::Input { day } => { + let response = client + .get(format!("https://adventofcode.com/2023/day/{day}/input")) + .header("Cookie", format!("session={auth}", auth = cli.auth)) + .send() + .await + .unwrap() + .text() + .await + .unwrap() + .trim_end() + .to_owned(); + + println!("{response}"); + }, } }