feat(args): add -L/--print-build-logs
flag, to feel more like nix3
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
6efdad5e66
commit
419976d275
2 changed files with 12 additions and 0 deletions
|
@ -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"),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue