From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/clap_builder/src/builder/arg_predicate.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 vendor/clap_builder/src/builder/arg_predicate.rs (limited to 'vendor/clap_builder/src/builder/arg_predicate.rs') diff --git a/vendor/clap_builder/src/builder/arg_predicate.rs b/vendor/clap_builder/src/builder/arg_predicate.rs new file mode 100644 index 0000000..bc79a11 --- /dev/null +++ b/vendor/clap_builder/src/builder/arg_predicate.rs @@ -0,0 +1,19 @@ +use crate::builder::OsStr; + +/// Operations to perform on argument values +/// +/// These do not apply to [`ValueSource::DefaultValue`][crate::parser::ValueSource::DefaultValue] +#[derive(Clone, Debug, PartialEq, Eq)] +#[cfg_attr(feature = "unstable-v5", non_exhaustive)] +pub enum ArgPredicate { + /// Is the argument present? + IsPresent, + /// Does the argument match the specified value? + Equals(OsStr), +} + +impl> From for ArgPredicate { + fn from(other: S) -> Self { + Self::Equals(other.into()) + } +} -- cgit v1.2.3