diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-12-01 22:35:23 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-12-01 22:35:23 -0500 |
commit | ff32088cffa839acd41b68fdce1db1d6c7fd6165 (patch) | |
tree | 30b35757c853786ec50bd9b48aac59e193b1647d /src/main.rs | |
parent | 6e7bcd5e4e9df984d40295860bba5a2b23893c18 (diff) | |
download | advent-of-code-ff32088cffa839acd41b68fdce1db1d6c7fd6165.tar.gz advent-of-code-ff32088cffa839acd41b68fdce1db1d6c7fd6165.zip |
puzzle 1-1
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index e7a11a9..b8677cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,23 @@ -fn main() { - println!("Hello, world!"); +#[path = "2020/mod.rs"] +mod year2020; + +#[derive(Debug, structopt::StructOpt)] +#[structopt(about = "Advent of Code")] +enum Opt { + #[structopt(name = "2020")] + Year2020 { day: u8, puzzle: u8 }, +} + +#[paw::main] +fn main(opt: Opt) { + let res = match opt { + Opt::Year2020 { day, puzzle } => crate::year2020::run(day, puzzle), + }; + match res { + Ok(()) => {} + Err(e) => { + eprintln!("{}", e); + std::process::exit(1); + } + } } |