Lines Matching defs:required

285     ///                     .required(false))
313 /// .required(false))
550 /// marked [`Arg::required`])
615 /// Required by default means it is required, when no other conflicting rules or overrides have
616 /// been evaluated. Conflicting rules take precedence over being required.
619 /// required by default. This is because if a flag were to be required, it should simply be
620 /// implied. No additional information is required from user. Flags by their very nature are
621 /// simply boolean on/off switches. The only time a user *should* be required to use a flag
630 /// .required(true)
634 /// Setting required requires that the argument be used at runtime.
640 /// .required(true)
650 /// Setting required and then *not* supplying that argument at runtime is an error.
656 /// .required(true)
668 pub fn required(self, yes: bool) -> Self {
676 /// Sets an argument that is required when this one is present
680 /// **NOTE:** [Conflicting] rules and [override] rules take precedence over being required
693 /// required
707 /// assert!(res.is_ok()); // We didn't use cfg, so input wasn't required
917 /// .required(true)
924 /// .required(true)
936 /// .expect("required");
940 /// .expect("required");
1113 /// using, such as `FILE`, `INTERFACE`, etc. Although not required, it's somewhat convention to
1173 /// using, such as `FILE`, `INTERFACE`, etc. Although not required, it's somewhat convention to
1261 /// When other arguments are conditionally required based on the
1698 /// [`.require_equals(true)`][Arg::require_equals] configuration option. These are required in
2896 /// Set this arg as [required] as long as the specified argument is not present at runtime.
2898 /// **Pro Tip:** Using `Arg::required_unless_present` implies [`Arg::required`] and is therefore not
2910 /// In the following example, the required argument is *not* provided,
2948 /// [required]: Arg::required()
2959 /// Sets this arg as [required] unless *all* of the specified arguments are present at runtime.
2965 /// **NOTE:** If you wish for this argument to only be required unless *any of* these args are
2977 /// In the following example, the required argument is *not* provided, but it's not an error
3023 /// [required]: Arg::required()
3035 /// Sets this arg as [required] unless *any* of the specified arguments are present at runtime.
3041 /// **NOTE:** If you wish for this argument to be required unless *all of* these args are
3055 /// required argument is *not* provided, but it's not an error because one the `unless` args
3101 /// [required]: Arg::required()
3113 /// This argument is [required] only if the specified `arg` is present at runtime and its value
3139 /// assert!(res.is_ok()); // We didn't use --other=special, so "cfg" wasn't required
3153 /// // We did use --other=special so "cfg" had become required but was missing.
3169 /// // By default, the comparison is case-sensitive, so "cfg" wasn't required
3191 /// [required]: Arg::required()
3198 /// Specify this argument is [required] based on multiple conditions.
3215 /// Setting `Arg::required_if_eq_any([(arg, val)])` makes this arg required if any of the `arg`s
3217 /// anything other than `val`, this argument isn't required.
3239 /// assert!(res.is_ok()); // We didn't use --option=spec, or --extra=val so "cfg" isn't required
3270 /// [required]: Arg::required()
3281 /// Specify this argument is [required] based on multiple conditions.
3298 /// Setting `Arg::required_if_eq_all([(arg, val)])` makes this arg required if all of the `arg`s
3300 /// anything other than `val`, this argument isn't required.
3322 /// assert!(res.is_ok()); // We didn't use --option=spec --extra=val so "cfg" isn't required
3351 /// [required]: Arg::required()
3366 /// If it does, `another_arg` will be marked as required.
3379 /// `val`, the other argument isn't required.
3393 /// assert!(res.is_ok()); // We didn't use --config=my.cfg, so other wasn't required
3442 /// than `val`, `arg` isn't required.
3462 /// assert!(res.is_err()); // We used --config=special.conf so --option <val> is required
3514 /// **NOTE:** Conflicting rules take precedence over being required by default. Conflict rules
3572 /// **NOTE:** Conflicting rules take precedence over being required by default. Conflict rules
3935 /// Reports whether [`Arg::required`] is set
4142 pub(crate) fn stylized(&self, required: Option<bool>) -> StyledStr {
4152 styled.extend(self.stylize_arg_suffix(required).into_iter());
4156 pub(crate) fn stylize_arg_suffix(&self, required: Option<bool>) -> StyledStr {
4177 let required = required.unwrap_or_else(|| self.is_required_set());
4178 let arg_val = self.render_arg_val(required);
4191 fn render_arg_val(&self, required: bool) -> String {
4209 let arg_name = if self.is_positional() && (num_vals.min_values() == 0 || !required) {
4551 let mut p = Arg::new("pos").index(1).num_args(1..).required(true);
4575 let mut p = Arg::new("pos").index(1).num_args(1..).required(true);
4605 .required(true);
4613 let mut p = Arg::new("pos").index(1).required(true);
4632 .required(true);
4642 .required(true)