Skip to content

Commit 24d13db

Browse files
committed
Nicer main
1 parent 4bb6a42 commit 24d13db

File tree

3 files changed

+249
-6
lines changed

3 files changed

+249
-6
lines changed

Cargo.lock

Lines changed: 231 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9+
clap = { version = "4.4", features = ["derive"] }

src/main.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
#![feature(btree_cursors)]
21

32
use std::path::PathBuf;
3+
use clap::Parser;
44

5-
// mod day01;
6-
// mod day02;
7-
// mod day03;
5+
mod day01;
6+
mod day02;
7+
mod day03;
88
mod day06;
99

10+
#[derive(Parser)]
11+
struct Args {
12+
#[arg(short, long, default_value_t = 0)]
13+
day: u8,
14+
}
15+
1016
fn main() {
17+
let args = Args::parse();
1118
let input = PathBuf::from("input");
12-
day06::day06(input);
19+
match args.day {
20+
1 => day01::day01(input),
21+
2 => day02::day02(input),
22+
3 => day03::day03(input),
23+
_ => day06::day06(input),
24+
}
1325
}

0 commit comments

Comments
 (0)