mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +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);
|
|
}
|