pub struct Args {
pub files: Vec<PathBuf>,
/* private fields */
}Expand description
A parsed command line: flags that were present, options with values, and the positionals.
Fields§
§files: Vec<PathBuf>Implementations§
Source§impl Args
impl Args
Sourcepub fn parse(
argv: Vec<String>,
flag_names: &[&str],
option_names: &[&str],
) -> Result<Parsed, String>
pub fn parse( argv: Vec<String>, flag_names: &[&str], option_names: &[&str], ) -> Result<Parsed, String>
flag_names take no value, option_names take the next argument or an = suffix.
pub fn has(&self, name: &str) -> bool
pub fn get(&self, name: &str) -> Option<&str>
Sourcepub fn all(&self, name: &str) -> Vec<String>
pub fn all(&self, name: &str) -> Vec<String>
Every value given for a repeatable option, in the order they were typed.
pub fn parse_number<T: FromStr>(&self, name: &str) -> Result<Option<T>, String>
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