Move command line args to new file

This commit is contained in:
Joscha 2023-08-07 14:18:01 +02:00
parent f8b974ad01
commit ad0c1a69cb
2 changed files with 24 additions and 19 deletions

19
src/args.rs Normal file
View file

@ -0,0 +1,19 @@
use std::path::PathBuf;
pub const NAME: &str = env!("CARGO_PKG_NAME");
pub const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", env!("VERGEN_GIT_SHA"), ")");
#[derive(Debug, clap::Parser)]
#[command(name = NAME, version = VERSION)]
pub struct Args {
/// Path to the repo's tablejohn database.
pub db: PathBuf,
/// Path to the git repo.
pub repo: PathBuf,
/// Path to the config file.
#[arg(long, short)]
pub config: Option<PathBuf>,
/// Enable increasingly more verbose output
#[arg(long, short, action = clap::ArgAction::Count)]
pub verbose: u8,
}