use clap::Parser;
use colored::Colorize;
use entropy_test_cli::{run_command, Cli};
use std::time::Instant;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let now = Instant::now();
let cli = Cli::parse();
let json_ouput = cli.json;
match run_command(cli, None, None, None, None, None).await {
Ok(output) => {
if json_ouput {
println!("{}", output);
} else {
println!("Success: {}", output.green());
println!("{}", format!("That took {:?}", now.elapsed()).yellow());
}
Ok(())
},
Err(err) => {
if !json_ouput {
eprintln!("{}", "Failed!".red());
}
Err(err)
},
}
}