use clap::Parser;
use crate::configs::app::AppConfig;
mod cli;
mod configs;
mod default;
mod engine;
mod models;
mod modifier;
mod output;
mod utils;
mod validate;
#[derive(Parser)]
#[command(name = utils::app::app_name())]
#[command(about = utils::app::app_about())]
#[command(styles = utils::app::app_styles())]
#[command(version = utils::app::app_version())]
struct App;
#[tokio::main]
async fn main() {
if let Err(e) = AppConfig::init() {
exit_error!("{}", e);
}
let config = match AppConfig::instance() {
Ok(v) => v,
Err(e) => exit_error!("{}", e),
};
let mut app_builder = build_app!(&config);
let matches = app_builder.clone().get_matches();
match matches.subcommand() {
Some((cmd_name, action_matches)) => {
cli::action::execute(cmd_name, action_matches, config).await;
}
_ => {
let _ = app_builder.print_help();
}
}
}