generated from GarandPLG/rust-flake-template
init
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
use crate::logs::init_logger;
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
#[command(version, about = "Veil.rs", long_about = "Veil.rs")]
|
||||
pub struct Cli {
|
||||
#[arg(
|
||||
long,
|
||||
short = 'l',
|
||||
help = "Enable logging to file (default: disabled)",
|
||||
default_value_t = false
|
||||
)]
|
||||
pub log: bool,
|
||||
}
|
||||
|
||||
impl Cli {
|
||||
pub fn get_args() -> Self {
|
||||
let args: Cli = Cli::parse();
|
||||
|
||||
if args.log {
|
||||
init_logger();
|
||||
}
|
||||
|
||||
args
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user