aoc2022/rust/src/main.rs

20 lines
444 B
Rust
Raw Normal View History

use std::env;
2022-12-02 14:19:49 -06:00
mod day1;
mod day2;
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(),
_ => eprintln!("error: invalid day")
}
},
_ => eprintln!("Error: not enough or too many arguments.")
};
2022-12-02 14:19:49 -06:00
}