clap/clap_derive/examples/at_least_two.rs
2020-01-18 17:40:07 +05:30

15 lines
284 B
Rust

//! How to require presence of at least N values,
//! like `val1 val2 ... valN ... valM`.
use clap::Clap;
#[derive(Clap, Debug)]
struct Opt {
#[clap(required = true, min_values = 2)]
foos: Vec<String>,
}
fn main() {
let opt = Opt::parse();
println!("{:?}", opt);
}