• Home
  • Raw
  • Download

Lines Matching refs:Opt

25     struct Opt {  in bool_type_is_flag()  struct
30 assert_eq!(Opt { alice: false }, Opt::try_parse_from(["test"]).unwrap()); in bool_type_is_flag()
32 Opt { alice: true }, in bool_type_is_flag()
33 Opt::try_parse_from(["test", "-a"]).unwrap() in bool_type_is_flag()
36 Opt { alice: true }, in bool_type_is_flag()
37 Opt::try_parse_from(["test", "-a", "-a"]).unwrap() in bool_type_is_flag()
40 Opt { alice: true }, in bool_type_is_flag()
41 Opt::try_parse_from(["test", "--alice"]).unwrap() in bool_type_is_flag()
43 assert!(Opt::try_parse_from(["test", "-i"]).is_err()); in bool_type_is_flag()
44 assert!(Opt::try_parse_from(["test", "-a", "foo"]).is_err()); in bool_type_is_flag()
58 struct Opt { in non_bool_type_flag() struct
65 let opt = Opt::try_parse_from(["test"]).unwrap(); in non_bool_type_flag()
69 let opt = Opt::try_parse_from(["test", "-a"]).unwrap(); in non_bool_type_flag()
73 let opt = Opt::try_parse_from(["test", "-b"]).unwrap(); in non_bool_type_flag()
77 let opt = Opt::try_parse_from(["test", "-b", "-a"]).unwrap(); in non_bool_type_flag()
86 struct Opt { in inferred_help() struct
92 let mut cmd = Opt::command(); in inferred_help()
107 struct Opt { in inferred_version() struct
113 let mut cmd = Opt::command(); in inferred_version()
130 struct Opt { in count() struct
138 Opt { alice: 0, bob: 0 }, in count()
139 Opt::try_parse_from(["test"]).unwrap() in count()
142 Opt { alice: 1, bob: 0 }, in count()
143 Opt::try_parse_from(["test", "-a"]).unwrap() in count()
146 Opt { alice: 2, bob: 0 }, in count()
147 Opt::try_parse_from(["test", "-a", "-a"]).unwrap() in count()
150 Opt { alice: 2, bob: 2 }, in count()
151 Opt::try_parse_from(["test", "-a", "--alice", "-bb"]).unwrap() in count()
154 Opt { alice: 3, bob: 1 }, in count()
155 Opt::try_parse_from(["test", "-aaa", "--bob"]).unwrap() in count()
157 assert!(Opt::try_parse_from(["test", "-i"]).is_err()); in count()
158 assert!(Opt::try_parse_from(["test", "-a", "foo"]).is_err()); in count()
164 struct Opt { in mixed_type_flags() struct
172 Opt { in mixed_type_flags()
176 Opt::try_parse_from(["test"]).unwrap() in mixed_type_flags()
179 Opt { in mixed_type_flags()
183 Opt::try_parse_from(["test", "-a"]).unwrap() in mixed_type_flags()
186 Opt { in mixed_type_flags()
190 Opt::try_parse_from(["test", "-a"]).unwrap() in mixed_type_flags()
193 Opt { in mixed_type_flags()
197 Opt::try_parse_from(["test", "-b"]).unwrap() in mixed_type_flags()
200 Opt { in mixed_type_flags()
204 Opt::try_parse_from(["test", "--alice", "--bob"]).unwrap() in mixed_type_flags()
207 Opt { in mixed_type_flags()
211 Opt::try_parse_from(["test", "-bb", "-a", "-bb"]).unwrap() in mixed_type_flags()
232 struct Opt { in ignore_qualified_bool_type() struct
237 Opt { in ignore_qualified_bool_type()
240 Opt::try_parse_from(["test", "success"]).unwrap() in ignore_qualified_bool_type()
247 struct Opt { in override_implicit_action() struct
253 Opt { arg: false }, in override_implicit_action()
254 Opt::try_parse_from(["test", "--arg", "false"]).unwrap() in override_implicit_action()
258 Opt { arg: true }, in override_implicit_action()
259 Opt::try_parse_from(["test", "--arg", "true"]).unwrap() in override_implicit_action()
266 struct Opt { in override_implicit_from_flag_positional() struct
272 Opt { arg: false }, in override_implicit_from_flag_positional()
273 Opt::try_parse_from(["test", "false"]).unwrap() in override_implicit_from_flag_positional()
277 Opt { arg: true }, in override_implicit_from_flag_positional()
278 Opt::try_parse_from(["test", "true"]).unwrap() in override_implicit_from_flag_positional()
285 struct Opt { in unit_for_negation() struct
293 Opt { in unit_for_negation()
297 Opt::try_parse_from(["test"]).unwrap() in unit_for_negation()
301 Opt { in unit_for_negation()
305 Opt::try_parse_from(["test", "--arg"]).unwrap() in unit_for_negation()
309 Opt { in unit_for_negation()
313 Opt::try_parse_from(["test", "--no-arg"]).unwrap() in unit_for_negation()
317 Opt { in unit_for_negation()
321 Opt::try_parse_from(["test", "--no-arg", "--arg"]).unwrap() in unit_for_negation()
325 Opt { in unit_for_negation()
329 Opt::try_parse_from(["test", "--arg", "--no-arg"]).unwrap() in unit_for_negation()