Lines Matching refs:Opt

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