Skip to content

Commit 73b6b67

Browse files
committed
Add an example with at least 2 arguments
1 parent 495cc1f commit 73b6b67

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/at_least_two.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#[macro_use]
2+
extern crate structopt;
3+
4+
use structopt::StructOpt;
5+
6+
#[derive(StructOpt, Debug)]
7+
struct Opt {
8+
#[structopt(raw(required = "true", min_values = "2"))]
9+
foos: Vec<String>,
10+
}
11+
12+
fn main() {
13+
let opt = Opt::from_args();
14+
println!("{:?}", opt);
15+
}

0 commit comments

Comments
 (0)