mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
15 lines
284 B
Rust
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);
|
|
}
|