Lines Matching defs:arg
38 /// # use clap::{Command, arg, ArgGroup, error::ErrorKind};
40 /// .arg(arg!(--"set-ver" <ver> "set the version manually"))
41 /// .arg(arg!(--major "auto increase major"))
42 /// .arg(arg!(--minor "auto increase minor"))
43 /// .arg(arg!(--patch "auto increase patch"))
56 /// # use clap::{Command, arg, ArgGroup, Id};
58 /// .arg(arg!(--"set-ver" <ver> "set the version manually"))
59 /// .arg(arg!(--major "auto increase major"))
60 /// .arg(arg!(--minor "auto increase minor"))
61 /// .arg(arg!(--patch "auto increase patch"))
70 /// // We can also ask the group which arg was used
77 /// // we could also alternatively check each arg individually (not shown here)
135 /// .arg(Arg::new("flag")
138 /// .arg(Arg::new("color")
142 /// .arg("flag")
143 /// .arg("color"))
152 pub fn arg(mut self, arg_id: impl IntoResettable<Id>) -> Self {
168 /// .arg(Arg::new("flag")
171 /// .arg(Arg::new("color")
186 self = self.arg(n);
200 /// for (pos, arg) in grp.get_args().enumerate() {
201 /// assert_eq!(*arg, args[pos]);
218 /// .arg(Arg::new("flag")
221 /// .arg(Arg::new("color")
237 /// .arg(Arg::new("flag")
240 /// .arg(Arg::new("color")
280 /// the usage string of the application in the format `<arg|arg2|arg3>`.
286 /// `ArgGroup::required(true)` states, "One and *only one* arg must be used from this group.
287 /// Use of more than one arg is an error." Vice setting `ArgGroup::multiple(true)` which
288 /// states, '*At least* one arg from this group must be used. Using multiple is OK."
295 /// .arg(Arg::new("flag")
298 /// .arg(Arg::new("color")
334 /// .arg(Arg::new("flag")
337 /// .arg(Arg::new("color")
340 /// .arg(Arg::new("debug")
347 /// // because we used an arg from the group, and the group requires "-d" to be used, it's an
378 /// .arg(Arg::new("flag")
381 /// .arg(Arg::new("color")
384 /// .arg(Arg::new("debug")
387 /// .arg(Arg::new("verb")
394 /// // because we used an arg from the group, and the group requires "-d" and "-v" to be used,
423 /// .arg(Arg::new("flag")
426 /// .arg(Arg::new("color")
429 /// .arg(Arg::new("debug")
436 /// // because we used an arg from the group, and the group conflicts with "-d", it's an error
464 /// .arg(Arg::new("flag")
467 /// .arg(Arg::new("color")
470 /// .arg(Arg::new("debug")
473 /// .arg(Arg::new("verb")
480 /// // because we used an arg from the group, and the group conflicts with either "-v" or "-d"
525 .arg("a1")
526 .arg("a4")
548 .arg("a1")
549 .arg("a4")
592 for (pos, arg) in grp.get_args().enumerate() {
593 assert_eq!(*arg, args[pos]);