use anyhow::Result;
use clap::Parser;
use env_logger::Env;
use std::io::Write;
mod cli;
use cli::{Command, route_command};
fn main() -> Result<()> {
env_logger::Builder::from_env(Env::default().default_filter_or("info"))
.format(|buf, record| writeln!(buf, "{}: {}", record.level(), record.args()))
.init();
#[derive(Parser)]
#[command(name = "dataprof")]
#[command(
version,
about = "Fast data profiler with ISO 8000/25012 quality metrics"
)]
struct SubcommandCli {
#[command(subcommand)]
command: Command,
}
let cli = SubcommandCli::parse();
match route_command(cli.command) {
Ok(_) => std::process::exit(0),
Err(e) => {
eprintln!("Error: {}", e);
std::process::exit(1);
}
}
}