Skip to content

Commit bd97e34

Browse files
committed
feat: add shorthands for running solutions
1 parent 6613b6b commit bd97e34

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.cargo/config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[alias]
2-
rr = "run --release"
32
scaffold = "run --bin scaffold -- "
43
download = "run --bin download -- "
4+
5+
day = "run --bin"
6+
all = "run"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Puzzle inputs are not checked into git. [Reasoning](https://old.reddit.com/r/adv
7272
### Run solutions for a day
7373

7474
```sh
75-
# example: `cargo run --bin 01`
76-
cargo run --bin <day>
75+
# example: `cargo day 01`
76+
cargo day <day>
7777

7878
# output:
7979
# Running `target/debug/01`
@@ -86,14 +86,14 @@ cargo run --bin <day>
8686
# 9 (elapsed: 33.18µs)
8787
```
8888

89-
To run an optimized version for benchmarking, use the `--release` flag or the alias `cargo rr --bin <day>`.
89+
`day` is a shorthand for `cargo run --bin `. To run an optimized version for benchmarking, append the `--release` flag.
9090

9191
Displayed _timings_ show the raw execution time of your solution without overhead (e.g. file reads).
9292

9393
### Run solutions for all days
9494

9595
```sh
96-
cargo run
96+
cargo all
9797

9898
# output:
9999
# Running `target/release/aoc`
@@ -111,7 +111,7 @@ cargo run
111111
# Total: 0.20ms
112112
```
113113

114-
To run an optimized version for benchmarking, use the `--release` flag or the alias `cargo rr`.
114+
`all` is an alias for `cargo run`. To run an optimized version for benchmarking, use the `--release` flag.
115115

116116
_Total timing_ is computed from individual solution _timings_ and excludes as much overhead as possible.
117117

src/bin/scaffold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ fn main() {
101101
}
102102

103103
println!("---");
104-
println!("🎄 Type `cargo run --bin {}` to run your solution.", &day_padded);
104+
println!("🎄 Type `cargo day {}` to run your solution.", &day_padded);
105105
}

0 commit comments

Comments
 (0)