#[cfg(feature = "dhat-heap")]
#[global_allocator]
static ALLOC: dhat::Alloc = dhat::Alloc;
use clap::Parser;
#[derive(Parser, Debug)]
#[command(
name = "forjar",
version,
about = "Rust-native Infrastructure as Code — bare-metal first, BLAKE3 state, provenance tracing"
)]
struct Cli {
#[arg(short, long, global = true, action = clap::ArgAction::Count)]
verbose: u8,
#[arg(long, global = true)]
no_color: bool,
#[command(subcommand)]
command: forjar::cli::Commands,
}
fn main() {
#[cfg(feature = "dhat-heap")]
let _profiler = dhat::Profiler::new_heap();
let cli = Cli::parse();
let no_color = cli.no_color || std::env::var("NO_COLOR").is_ok();
if let Err(e) = forjar::cli::dispatch_classified(cli.command, cli.verbose, no_color) {
eprintln!("error: {e}");
std::process::exit(e.exit_code());
}
}