f73de24fd7
Allows logging to be controlled with, for example: just log=trace run
23 lines
466 B
Rust
23 lines
466 B
Rust
use crate::common::*;
|
|
|
|
pub fn run() -> Result<(), i32> {
|
|
#[cfg(windows)]
|
|
ansi_term::enable_ansi_support().ok();
|
|
|
|
env_logger::Builder::from_env(
|
|
env_logger::Env::new()
|
|
.filter("JUST_LOG")
|
|
.write_style("JUST_LOG_STYLE"),
|
|
)
|
|
.init();
|
|
|
|
let app = Config::app();
|
|
|
|
info!("Parsing command line arguments…");
|
|
let matches = app.get_matches();
|
|
|
|
let config = Config::from_matches(&matches).eprint(Color::auto())?;
|
|
|
|
config.run_subcommand()
|
|
}
|