pub struct Spec<C> { /* private fields */ }
Expand description
Option/argument specification.
Implementations§
Source§impl<C> Spec<C>
impl<C> Spec<C>
Sourcepub fn is_capture_rest(&self) -> bool
pub fn is_capture_rest(&self) -> bool
Return a boolean indicating whether this arg spec is configured to capture all the remaining arguments.
Sourcepub fn is_exit(&self) -> bool
pub fn is_exit(&self) -> bool
Return boolean indicating whether this arg spec will abort the parser.
Sourcepub fn is_opt(&self) -> bool
pub fn is_opt(&self) -> bool
Return boolean indicating whether this arg spec represents an “option”.
“Options” come in two forms: short or long
Short options are in the form “
Long options are in the form “
This function will return true for either form.
Sourcepub fn is_pos(&self) -> bool
pub fn is_pos(&self) -> bool
Return boolean indicating whether this arg is a positional argument.
pub fn is_req(&self) -> bool
pub fn get_nargs(&self) -> usize
pub fn req_args(&self) -> bool
pub fn get_opts_usage_str(&self) -> String
Sourcepub fn get_usage_str(&self) -> String
pub fn get_usage_str(&self) -> String
Generate a string that shows a representation of this argument specification suitable for use in a “Usage: “ string.
Required parameters are enclosed by ‘<’ and ‘>’ charcters. Optional parameters are enclossed by ‘[’ and ‘]’ characters.