use clap::Parser;
use rustchain::cli::commands_pretty::Cli;
use rustchain::cli::handlers_pretty::PrettyCliHandler;
use rustchain::core::config::Config;
use std::process;
#[tokio::main]
async fn main() {
let cli = Cli::parse();
init_clean_logging();
let config = Config::default();
let handler = PrettyCliHandler::new(config);
if let Err(e) = handler.handle(cli).await {
eprintln!("❌ Error: {}", e);
process::exit(1);
}
}
fn init_clean_logging() {
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", "warn"); }
let _result = tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::from_default_env())
.with(
tracing_subscriber::fmt::layer()
.with_target(false)
.with_file(false)
.with_line_number(false)
.compact()
)
.try_init();
}