mod app;
mod cli;
mod commands;
mod config;
mod error;
mod license;
mod models;
mod utils;
use crate::models::Cli;
use app::LichenApp;
use std::process::ExitCode;
use clap::Parser;
use log::{debug, error, trace};
#[tokio::main]
async fn main() -> ExitCode {
let cli = Cli::parse();
env_logger::Builder::new()
.filter_level(cli.verbose.log_level_filter())
.init();
trace!("Lichen starting...");
debug!("CLI arguments parsed: {:?}", cli);
debug!("Effective log level: {}", cli.verbose.log_level_filter());
debug!("Configuration loading step (currently placeholder).");
let lichen_app = LichenApp::new();
let config_path = cli.config.unwrap_or(".lichen.toml".into());
let result = lichen_app.run(cli.command, config_path).await;
match result {
Ok(_) => ExitCode::SUCCESS,
Err(e) => {
error!("Command failure, because of... a {}", e);
ExitCode::FAILURE
}
}
}