Lines Matching refs:Opt
25 struct Opt {
30 Opt { arg: 42 },
31 Opt::try_parse_from(["test", "-a42"]).unwrap()
34 Opt { arg: 42 },
35 Opt::try_parse_from(["test", "-a", "42"]).unwrap()
38 Opt { arg: 42 },
39 Opt::try_parse_from(["test", "--arg", "42"]).unwrap()
42 Opt { arg: 42 },
43 Opt::try_parse_from(["test", "--arg", "24", "--arg", "42"]).unwrap()
45 assert!(Opt::try_parse_from(["test"]).is_err());
52 struct Opt {
57 Opt { arg: 24 },
58 Opt::try_parse_from(["test", "-a24"]).unwrap()
61 Opt { arg: 42 },
62 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
64 assert_eq!(Opt { arg: 42 }, Opt::try_parse_from(["test"]).unwrap());
71 struct Opt {
76 Opt { arg: 24 },
77 Opt::try_parse_from(["test", "-a24"]).unwrap()
80 Opt { arg: 42 },
81 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
83 assert_eq!(Opt { arg: 42 }, Opt::try_parse_from(["test"]).unwrap());
101 struct Opt {
105 assert_eq!(Opt { a: None }, Opt::try_parse_from(["test"]).unwrap());
107 Opt { a: Some(A) },
108 Opt::try_parse_from(["test", "foo"]).unwrap()
127 struct Opt {
132 Opt { a: Vec::new() },
133 Opt::try_parse_from(["test"]).unwrap()
136 Opt { a: vec![A] },
137 Opt::try_parse_from(["test", "foo"]).unwrap()
156 struct Opt {
161 assert_eq!(Opt { a: None }, Opt::try_parse_from(["test"]).unwrap());
163 Opt { a: Some(vec![A]) },
164 Opt::try_parse_from(["test", "-a", "foo"]).unwrap()
172 struct Opt {
177 Opt { arg: Some(42) },
178 Opt::try_parse_from(["test", "-a42"]).unwrap()
181 Opt { arg: Some(42) },
182 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
184 assert_eq!(Opt { arg: None }, Opt::try_parse_from(["test"]).unwrap());
192 struct Opt {
209 Opt {
213 Opt::try_parse_from(["test", "arg"]).unwrap()
217 Opt {
221 Opt::try_parse_from(["test", "ex-sub", "-v"]).unwrap()
224 assert!(Opt::try_parse_from(["test"]).is_err());
235 struct Opt {
241 Opt {
244 Opt::try_parse_from(["test", "success"]).unwrap()
252 struct Opt {
258 Opt {
261 Opt::try_parse_from(["test", "-a42"]).unwrap()
264 Opt { arg: Some(None) },
265 Opt::try_parse_from(["test", "-a"]).unwrap()
268 Opt {
271 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
273 assert_eq!(Opt { arg: None }, Opt::try_parse_from(["test"]).unwrap());
280 struct Opt {
284 let help = utils::get_help::<Opt>();
293 struct Opt {
301 Opt {
305 Opt::try_parse_from(["test", "-a42", "--field", "f"]).unwrap()
308 Opt {
312 Opt::try_parse_from(["test", "-a42", "--field"]).unwrap()
315 Opt {
319 Opt::try_parse_from(["test", "-a", "--field"]).unwrap()
322 Opt {
326 Opt::try_parse_from(["test", "-a", "--field", "f"]).unwrap()
329 Opt {
333 Opt::try_parse_from(["test", "--field"]).unwrap()
336 Opt {
340 Opt::try_parse_from(["test"]).unwrap()
348 struct Opt {
353 Opt { arg: vec![24] },
354 Opt::try_parse_from(["test", "-a24"]).unwrap()
356 assert_eq!(Opt { arg: vec![] }, Opt::try_parse_from(["test"]).unwrap());
358 Opt { arg: vec![24, 42] },
359 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
367 struct Opt {
372 Opt { arg: vec![24] },
373 Opt::try_parse_from(["test", "-a24"]).unwrap()
375 assert!(Opt::try_parse_from(["test"]).is_err());
377 Opt { arg: vec![24, 42] },
378 Opt::try_parse_from(["test", "-a", "24", "-a", "42"]).unwrap()
386 struct Opt {
391 Opt { arg: vec![24] },
392 Opt::try_parse_from(["test", "-a24"]).unwrap()
394 assert_eq!(Opt { arg: vec![] }, Opt::try_parse_from(["test"]).unwrap());
396 Opt { arg: vec![24, 42] },
397 Opt::try_parse_from(["test", "-a", "24", "42"]).unwrap()
409 struct Opt {
415 Opt {
418 Opt::try_parse_from(["test", "success"]).unwrap()
426 struct Opt {
431 Opt { arg: Some(vec![1]) },
432 Opt::try_parse_from(["test", "-a", "1"]).unwrap()
436 Opt {
439 Opt::try_parse_from(["test", "-a", "1", "-a", "2"]).unwrap()
442 assert_eq!(Opt { arg: None }, Opt::try_parse_from(["test"]).unwrap());
449 struct Opt {
454 Opt { arg: Some(vec![1]) },
455 Opt::try_parse_from(["test", "-a", "1"]).unwrap()
459 Opt {
462 Opt::try_parse_from(["test", "-a", "1", "2"]).unwrap()
466 Opt { arg: Some(vec![]) },
467 Opt::try_parse_from(["test", "-a"]).unwrap()
470 assert_eq!(Opt { arg: None }, Opt::try_parse_from(["test"]).unwrap());
477 struct Opt {
486 Opt {
490 Opt::try_parse_from(["test", "-a", "1"]).unwrap()
494 Opt {
498 Opt::try_parse_from(["test", "-a", "1", "-b", "1"]).unwrap()
502 Opt {
506 Opt::try_parse_from(["test", "-a", "1", "-a", "2", "-b", "1", "-b", "2"]).unwrap()
510 Opt { arg: None, b: None },
511 Opt::try_parse_from(["test"]).unwrap()
519 struct Opt {
524 Opt { arg: 42 },
525 Opt::try_parse_from(["test", "--arg", "42"]).unwrap()
533 struct Opt {
538 Opt { arg: 42 },
539 Opt::try_parse_from(["test", "--arg", "42"]).unwrap()