pub struct ARG_OUTPUT { /* private fields */ }Methods from Deref<Target = Arg>§
Sourcepub fn get_long_help(&self) -> Option<&StyledStr>
pub fn get_long_help(&self) -> Option<&StyledStr>
Get the long help specified for this argument, if any
§Examples
let arg = Arg::new("foo").long_help("long help");
assert_eq!(Some("long help".to_owned()), arg.get_long_help().map(|s| s.to_string()));Sourcepub fn get_display_order(&self) -> usize
pub fn get_display_order(&self) -> usize
Get the placement within help
Sourcepub fn get_help_heading(&self) -> Option<&str>
pub fn get_help_heading(&self) -> Option<&str>
Get the help heading specified for this argument, if any
Sourcepub fn get_visible_short_aliases(&self) -> Option<Vec<char>>
pub fn get_visible_short_aliases(&self) -> Option<Vec<char>>
Get visible short aliases for this argument, if any
Sourcepub fn get_all_short_aliases(&self) -> Option<Vec<char>>
pub fn get_all_short_aliases(&self) -> Option<Vec<char>>
Get all short aliases for this argument, if any, both visible and hidden.
Sourcepub fn get_short_and_visible_aliases(&self) -> Option<Vec<char>>
pub fn get_short_and_visible_aliases(&self) -> Option<Vec<char>>
Get the short option name and its visible aliases, if any
Sourcepub fn get_visible_aliases(&self) -> Option<Vec<&str>>
pub fn get_visible_aliases(&self) -> Option<Vec<&str>>
Get visible aliases for this argument, if any
Sourcepub fn get_all_aliases(&self) -> Option<Vec<&str>>
pub fn get_all_aliases(&self) -> Option<Vec<&str>>
Get all aliases for this argument, if any, both visible and hidden.
Sourcepub fn get_long_and_visible_aliases(&self) -> Option<Vec<&str>>
pub fn get_long_and_visible_aliases(&self) -> Option<Vec<&str>>
Get the long option name and its visible aliases, if any
Sourcepub fn get_aliases(&self) -> Option<Vec<&str>>
pub fn get_aliases(&self) -> Option<Vec<&str>>
Get hidden aliases for this argument, if any
Sourcepub fn get_possible_values(&self) -> Vec<PossibleValue>
pub fn get_possible_values(&self) -> Vec<PossibleValue>
Get the names of possible values for this argument. Only useful for user facing applications, such as building help messages or man files
Sourcepub fn get_value_names(&self) -> Option<&[Str]>
pub fn get_value_names(&self) -> Option<&[Str]>
Get the names of values for this argument.
Sourcepub fn get_num_args(&self) -> Option<ValueRange>
pub fn get_num_args(&self) -> Option<ValueRange>
Get the number of values for this argument.
Sourcepub fn get_value_delimiter(&self) -> Option<char>
pub fn get_value_delimiter(&self) -> Option<char>
Get the delimiter between multiple values
Sourcepub fn get_value_terminator(&self) -> Option<&Str>
pub fn get_value_terminator(&self) -> Option<&Str>
Get the value terminator for this argument. The value_terminator is a value
that terminates parsing of multi-valued arguments.
Sourcepub fn get_value_hint(&self) -> ValueHint
pub fn get_value_hint(&self) -> ValueHint
Get the value hint of this argument
Sourcepub fn get_default_values(&self) -> &[OsStr]
pub fn get_default_values(&self) -> &[OsStr]
Get the default values specified for this argument, if any
§Examples
let arg = Arg::new("foo").default_value("default value");
assert_eq!(arg.get_default_values(), &["default value"]);Sourcepub fn is_positional(&self) -> bool
pub fn is_positional(&self) -> bool
Checks whether this argument is a positional or not.
§Examples
let arg = Arg::new("foo");
assert_eq!(arg.is_positional(), true);
let arg = Arg::new("foo").long("foo");
assert_eq!(arg.is_positional(), false);Sourcepub fn is_required_set(&self) -> bool
pub fn is_required_set(&self) -> bool
Reports whether Arg::required is set
Sourcepub fn is_allow_hyphen_values_set(&self) -> bool
pub fn is_allow_hyphen_values_set(&self) -> bool
Report whether Arg::allow_hyphen_values is set
Sourcepub fn is_allow_negative_numbers_set(&self) -> bool
pub fn is_allow_negative_numbers_set(&self) -> bool
Report whether Arg::allow_negative_numbers is set
Sourcepub fn get_action(&self) -> &ArgAction
pub fn get_action(&self) -> &ArgAction
Behavior when parsing the argument
Sourcepub fn get_value_parser(&self) -> &ValueParser
pub fn get_value_parser(&self) -> &ValueParser
Configured parser for argument values
§Example
let cmd = clap::Command::new("raw")
.arg(
clap::Arg::new("port")
.value_parser(clap::value_parser!(usize))
);
let value_parser = cmd.get_arguments()
.find(|a| a.get_id() == "port").unwrap()
.get_value_parser();
println!("{value_parser:?}");Sourcepub fn is_global_set(&self) -> bool
pub fn is_global_set(&self) -> bool
Report whether Arg::global is set
Sourcepub fn is_next_line_help_set(&self) -> bool
pub fn is_next_line_help_set(&self) -> bool
Report whether Arg::next_line_help is set
Sourcepub fn is_hide_set(&self) -> bool
pub fn is_hide_set(&self) -> bool
Report whether Arg::hide is set
Sourcepub fn is_hide_default_value_set(&self) -> bool
pub fn is_hide_default_value_set(&self) -> bool
Report whether Arg::hide_default_value is set
Sourcepub fn is_hide_possible_values_set(&self) -> bool
pub fn is_hide_possible_values_set(&self) -> bool
Report whether Arg::hide_possible_values is set
Sourcepub fn is_hide_short_help_set(&self) -> bool
pub fn is_hide_short_help_set(&self) -> bool
Report whether Arg::hide_short_help is set
Sourcepub fn is_hide_long_help_set(&self) -> bool
pub fn is_hide_long_help_set(&self) -> bool
Report whether Arg::hide_long_help is set
Sourcepub fn is_require_equals_set(&self) -> bool
pub fn is_require_equals_set(&self) -> bool
Report whether Arg::require_equals is set
Sourcepub fn is_exclusive_set(&self) -> bool
pub fn is_exclusive_set(&self) -> bool
Reports whether Arg::exclusive is set
Sourcepub fn is_trailing_var_arg_set(&self) -> bool
pub fn is_trailing_var_arg_set(&self) -> bool
Report whether Arg::trailing_var_arg is set
Sourcepub fn is_last_set(&self) -> bool
pub fn is_last_set(&self) -> bool
Reports whether Arg::last is set
Sourcepub fn is_ignore_case_set(&self) -> bool
pub fn is_ignore_case_set(&self) -> bool
Reports whether Arg::ignore_case is set
Trait Implementations§
Source§impl Deref for ARG_OUTPUT
impl Deref for ARG_OUTPUT
impl LazyStatic for ARG_OUTPUT
Auto Trait Implementations§
impl Freeze for ARG_OUTPUT
impl RefUnwindSafe for ARG_OUTPUT
impl Send for ARG_OUTPUT
impl Sync for ARG_OUTPUT
impl Unpin for ARG_OUTPUT
impl UnwindSafe for ARG_OUTPUT
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more