Lines Matching defs:args

45 ///          .args(["set-ver", "major", "minor", "patch"])
48 /// // Because we used two args in the group it's an error
63 /// .args(["set-ver", "major", "minor","patch"])
68 /// // We may not know which of the args was used, so we can test for the group...
88 pub(crate) args: Vec<Id>,
154 self.args.push(arg_id);
156 self.args.clear();
175 /// .args(["flag", "color"]))
184 pub fn args(mut self, ns: impl IntoIterator<Item = impl Into<Id>>) -> Self {
191 /// Getters for all args. It will return a vector of `Id`
197 /// let args: Vec<&str> = vec!["a1".into(), "a4".into()];
198 /// let grp = ArgGroup::new("program").args(&args);
201 /// assert_eq!(*arg, args[pos]);
205 self.args.iter()
225 /// .args(["flag", "color"])
232 /// an error if more than one of the args in the group was used.
244 /// .args(["flag", "color"]))
246 /// // Because we used both args in the group it's an error
268 /// .args(["f", "c"])
302 /// .args(["flag", "color"])
305 /// // Because we didn't use any of the args in the group, it's an error
344 /// .args(["flag", "color"])
391 /// .args(["flag", "color"])
433 /// .args(["flag", "color"])
477 /// .args(["flag", "color"])
527 .args(["a2", "a3"])
536 let args: Vec<Id> = vec!["a1".into(), "a4".into(), "a2".into(), "a3".into()];
540 assert_eq!(g.args, args);
550 .args(["a2", "a3"])
559 let args: Vec<Id> = vec!["a1".into(), "a4".into(), "a2".into(), "a3".into()];
564 assert_eq!(g2.args, args);
578 let args: Vec<Id> = vec!["a1".into(), "a4".into()];
580 let mut grp_multiple = ArgGroup::new("test_multiple").args(&args).multiple(true);
583 let mut grp_not_multiple = ArgGroup::new("test_multiple").args(&args).multiple(false);
589 let args: Vec<Id> = vec!["a1".into(), "a4".into()];
590 let grp = ArgGroup::new("program").args(&args);
593 assert_eq!(*arg, args[pos]);