pub trait ArgumentParser {
// Required methods
fn contains(&self, arg: &str) -> bool;
fn get_all(
&self,
arg: &str,
has_value: bool,
) -> Vec<(RangeInclusive<usize>, String)>;
}Expand description
Helper trait to provide simple argument parsing over Vec<String>.
Required Methods§
Sourcefn contains(&self, arg: &str) -> bool
fn contains(&self, arg: &str) -> bool
Check whether an argument flag exists, either as a standalone flag or
in --flag=value form.
Sourcefn get_all(
&self,
arg: &str,
has_value: bool,
) -> Vec<(RangeInclusive<usize>, String)>
fn get_all( &self, arg: &str, has_value: bool, ) -> Vec<(RangeInclusive<usize>, String)>
Extract all occurrences of an argument and their values.
When has_value is true, this matches --flag value and
--flag=value forms and returns the value part. When has_value is
false, it matches bare flags like --flag.