use std::{path::PathBuf, str::FromStr, sync::Arc}; use camino::Utf8PathBuf; use clap::Parser; lazy_static::lazy_static!( pub static ref CLIARGS: Arc = Arc::new(CliArgs::parse()); ); #[derive(Debug, clap::Parser)] pub struct CliArgs { /// Manifest path #[arg(long, short)] manifest: Option, /// settings file path #[arg(long, short, default_value="./settings.toml")] settings: camino::Utf8PathBuf, /// Cache dir path #[arg(long, short)] cache: Option, /// Debug mode #[arg(long, short)] pub debug: bool, } impl CliArgs { pub fn manifest_path(&self) -> Option { self.manifest.clone() } pub fn settings_path(&self) -> Utf8PathBuf { self.settings.clone() } pub fn cache_path(&self) -> Option { self.cache.clone() } }