1use clap::{Parser, ValueHint};
2use std::path::PathBuf;
3
4pub fn parse() -> Arguments {
5 Arguments::parse()
6}
7
8#[derive(Parser)]
9#[command(about, author, version)]
10pub struct Arguments {
11 /// Commit, tag, or branch to start scanning from.
12 #[arg(long, value_name = "from-revspec", default_value = "HEAD")]
13 pub from: String,
14
15 /// Optional commit, tag, or branch to stop scanning.
16 #[arg(long, value_name = "to-revspec")]
17 pub to: Option<String>,
18
19 /// Preserve timezone in timestamp output.
20 #[arg{long}]
21 pub preserve_tz: bool,
22
23 /// Path to the git repository.
24 #[arg(long, short = 'R', value_hint = ValueHint::DirPath, default_value = ".")]
25 pub repository: PathBuf,
26
27 /// Maximum search time in milliseconds.
28 #[cfg(feature = "time-budget")]
29 #[arg(long, default_value_t = u64::MAX)]
30 pub time_limit: u64,
31
32 pub subtree: Option<PathBuf>,
33}