pub(crate) struct Args(pub(crate) Vec<String>);Expand description
Command-line arguments: positional words, and --name value options that may repeat.
Tuple Fields§
§0: Vec<String>Implementations§
Source§impl Args
impl Args
Sourcepub(crate) fn check(&self, known: &[&str]) -> Result<(), Failure>
pub(crate) fn check(&self, known: &[&str]) -> Result<(), Failure>
Refuses what would otherwise be ignored without a word: an option the command does not know (a
misspelt one), an option without its value, and two motions at once. known are the command’s own
options beside the common ones.
pub(crate) fn options(&self, name: &str) -> Vec<&str>
pub(crate) fn option(&self, name: &str) -> Option<&str>
pub(crate) fn flag(&self, name: &str) -> bool
pub(crate) fn number(&self, name: &str) -> Result<Option<f64>, Failure>
Sourcepub(crate) fn positional(&self, n: usize) -> Option<&str>
pub(crate) fn positional(&self, n: usize) -> Option<&str>
The n-th word that is neither an option nor an option’s value.
Auto Trait Implementations§
impl Freeze for Args
impl RefUnwindSafe for Args
impl Send for Args
impl Sync for Args
impl Unpin for Args
impl UnsafeUnpin for Args
impl UnwindSafe for Args
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
Mutably borrows from an owned value. Read more