use clap::{Parser, ValueHint}; use std::path::PathBuf; pub fn parse() -> Arguments { Arguments::parse() } #[derive(Parser)] #[command(about, author, version)] pub struct Arguments { /// Commit, tag, or branch to start scanning from. #[arg(long, value_name = "from-revspec", default_value = "HEAD")] pub from: String, /// Optional commit, tag, or branch to stop scanning. #[arg(long, value_name = "to-revspec")] pub to: Option, /// Preserve timezone in timestamp output. #[arg{long}] pub preserve_tz: bool, /// Path to the git repository. #[arg(long, short = 'R', value_hint = ValueHint::DirPath, default_value = ".")] pub repository: PathBuf, /// Maximum search time in milliseconds. #[cfg(feature = "time-budget")] #[arg(long, default_value_t = u64::MAX)] pub time_limit: u64, pub subtree: Option, }