Lines Matching refs:arg
1 use clap::{arg, error::ErrorKind, Arg, ArgAction, Command};
6 .args([arg!(f: -f [flag] "some opt"), arg!([arg] "some arg")])
10 assert!(m.contains_id("arg"));
13 m.get_one::<String>("arg").map(|v| v.as_str()).unwrap(),
21 .arg(arg!(--exact "filters match exactly").action(ArgAction::SetTrue))
22 .arg(
44 arg!(-f --flag "some flag").action(ArgAction::SetTrue),
61 arg!(-f --flag "some flag").action(ArgAction::SetTrue),
79 .arg(arg!(<opt>... "some pos"))
120 arg!(-f --flag "some flag").action(ArgAction::SetTrue),
144 arg!(-f --flag "some flag").action(ArgAction::SetTrue),
167 .args([arg!(-f --flag "some flag"), Arg::new("positional").index(1)])
178 arg!(-f --flag "some flag").action(ArgAction::SetTrue),
198 .arg(Arg::new("test").index(1).help("testing testing"))
206 .arg(Arg::new("dummy"))
213 let mut cmd = Command::new("test").arg(arg!([FILE] "some file"));
219 let mut cmd = Command::new("test").arg(arg!([FILE]... "some file"));
226 .arg(arg!([FILE] "some file"))
227 .arg(arg!([FILES]... "some file"));
238 .arg(arg!(<FILE> "some file"))
239 .arg(arg!([FILES]... "some file"));
248 let mut cmd = Command::new("test").arg(arg!(<FILE> "some file"));
259 .arg(arg!([FILE1] "some file"))
260 .arg(arg!(<FILE2> "some file"))
267 .arg(arg!(<FILE1> "some file"))
268 .arg(arg!(<FILE2> "some file"))
277 .arg(arg!(<TARGET> "some target"))
278 .arg(arg!([CORPUS] "some corpus"))
279 .arg(arg!([ARGS]... "some file").last(true))
280 .try_get_matches_from(vec!["test", "tgt", "--", "arg"]);
288 ["arg"]
295 .arg(arg!(<TARGET> "some target"))
296 .arg(arg!([CORPUS] "some corpus"))
297 .arg(arg!([ARGS]... "some file").last(true))
298 .try_get_matches_from(vec!["test", "tgt", "crp", "arg"]);
306 .arg(arg!(<TARGET> "some target"))
307 .arg(arg!([CORPUS]... "some corpus"))
308 .arg(arg!([ARGS]... "some file").last(true))
309 .try_get_matches_from(vec!["test", "tgt", "crp1", "crp2", "--", "arg"]);
315 #[should_panic = "Argument 'arg' is a positional argument and can't have short or long name versions"]
320 .arg(Arg::new("arg").index(1).long("arg"))
326 #[should_panic = "Argument 'arg' is a positional argument and can't have short or long name versions"]
331 .arg(Arg::new("arg").index(1).short('a'))
338 .arg(
344 .arg(