feat(args): add -L/--print-build-logs flag, to feel more like nix3
All checks were successful
conventional commits / conventional commits (push) Successful in 12s
build / run (push) Successful in 1m3s
check / run (push) Successful in 1m38s

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2024-09-12 11:21:10 +02:00
parent 6efdad5e66
commit 419976d275
Signed by: cafkafk
GPG key ID: 26C542FD97F965CE
2 changed files with 12 additions and 0 deletions

View file

@ -31,4 +31,9 @@ pub fn build_cli() -> Command {
.required(false),
)
.arg(arg!(-v --verbose ... "Verbosity level."))
.arg(
arg!(printBuildLogs: -L "Verbosity level.")
.long("print-build-logs")
.conflicts_with("verbose"),
)
}

View file

@ -37,6 +37,8 @@ async fn main() -> io::Result<()> {
// message informing them.
let mut very_bose = false;
// The Normal verbose flag, allowing multiple levels. Conflicts with
// printBuildLogs.
match matches
.get_one::<u8>("verbose")
.expect("Counts aren't defaulted")
@ -52,6 +54,11 @@ async fn main() -> io::Result<()> {
}
}
// The -L flag, to give a more nix3 feel
if matches.get_flag("printBuildLogs") {
env::set_var("RUST_LOG", "trace")
}
if matches.get_flag("timestamp") {
pretty_env_logger::formatted_timed_builder()
.parse_env("RUST_LOG")