1use std::ffi::OsString;
6use std::path::PathBuf;
7
8use clap::Parser;
9
10#[derive(Debug, Clone, Parser)]
11#[command(name = "cargo-grip4rust", version = "0.1.3")]
12#[command(about = "Measure Rust testability")]
13pub struct Args {
14 #[arg(default_value = ".")]
15 pub path: PathBuf,
16
17 #[arg(long)]
18 pub json: bool,
19
20 #[arg(long, alias = "min-score")]
21 pub threshold: Option<u32>,
22}
23
24impl Args {
25 pub fn parse_from_args<I, T>(args: I) -> Self
26 where
27 I: IntoIterator<Item = T>,
28 T: Into<OsString> + Clone,
29 {
30 Self::parse_from(args)
31 }
32}