clap/examples/at_least_two.rs

16 lines
264 B
Rust
Raw Normal View History

#[macro_use]
extern crate structopt;
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
struct Opt {
#[structopt(raw(required = "true", min_values = "2"))]
foos: Vec<String>,
}
fn main() {
let opt = Opt::from_args();
println!("{:?}", opt);
}