blob: af137fde47407520739b5dbda005bbcf916abc13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
mod util;
#[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(answer) => {
println!("{}", answer);
}
Err(e) => {
eprintln!("{}", e);
std::process::exit(1);
}
}
}
|