aoc2022/rust/src/main.rs

24 lines
542 B
Rust
Raw Normal View History

use std::env;
2022-12-02 14:19:49 -06:00
mod day1;
mod day2;
2022-12-09 01:47:37 -06:00
mod day3;
2022-12-11 17:05:00 -06:00
mod day4;
2022-12-02 14:19:49 -06:00
fn main() {
let args: Vec<String> = env::args().collect();
match args.len() {
2 => {
let day_to_run = &args[1];
match &day_to_run[..] {
"day1" => day1::run(),
"day2" => day2::run(),
2022-12-09 01:47:37 -06:00
"day3" => day3::run(),
2022-12-11 17:05:00 -06:00
"day4" => day4::run(),
_ => eprintln!("error: invalid day")
}
},
_ => eprintln!("Error: not enough or too many arguments.")
};
2022-12-02 14:19:49 -06:00
}