cli: Allow configuring output colorization

We now follow the <https://bixense.com/clicolors> standard.
This commit is contained in:
Zhaofeng Li 2021-12-04 01:03:26 -08:00
parent dc57b489ea
commit f253e6eb18
5 changed files with 59 additions and 16 deletions

View file

@ -1,7 +1,5 @@
#![deny(unused_must_use)]
use std::env;
mod nix;
mod cli;
mod command;
@ -12,17 +10,5 @@ mod util;
#[tokio::main]
async fn main() {
init_logging();
cli::run().await;
}
fn init_logging() {
if env::var("RUST_LOG").is_err() {
// HACK
env::set_var("RUST_LOG", "info")
}
env_logger::builder()
.format_timestamp(None)
.format_module_path(false)
.init();
}