Debian Codegraph @

debian/rust-vendor/codspeed-divan-compat/src/compat/cli.rs

raw
1 use clap::{Arg, ArgAction, Command};
2
3 pub(crate) fn command() -> Command {
4 fn option(name: &'static str) -> Arg {
5 Arg::new(name).long(name)
6 }
7
8 fn flag(name: &'static str) -> Arg {
9 option(name).action(ArgAction::SetTrue)
10 }
11
12 Command::new("divan")
13 .arg(
14 Arg::new("filter")
15 .value_name("FILTER")
16 .help("Only run benchmarks whose names match this pattern")
17 .action(ArgAction::Append),
18 )
19 .arg(flag("exact").help("Filter benchmarks by exact name rather than by pattern"))
20 }