25 lines
734 B
Rust
25 lines
734 B
Rust
use std::env;
|
|
|
|
fn main() {
|
|
let day = match env::args().nth(1) {
|
|
Some(arg) => arg.parse().unwrap(),
|
|
None => 1
|
|
};
|
|
|
|
let result = match day {
|
|
1 => advent_of_code::aoc01::both("./inputs/01-01.txt"),
|
|
2 => advent_of_code::aoc02::both("./inputs/02-01.txt"),
|
|
3 => advent_of_code::aoc03::both("./inputs/03-01.txt"),
|
|
4 => advent_of_code::aoc04::both("./inputs/04-01.txt"),
|
|
5 => advent_of_code::aoc05::both("./inputs/05-01.txt"),
|
|
6 => advent_of_code::aoc06::both("./inputs/06-01.txt"),
|
|
_ => Err(format!("unsupported day {}", day).into()),
|
|
};
|
|
|
|
match result {
|
|
Ok(_) => (),
|
|
Err(e) => println!("Error executing day {}: {}", day, e),
|
|
}
|
|
|
|
}
|