Struct rargsxd::ArgParser[][src]

pub struct ArgParser {
    pub extra: Vec<String>,
    // some fields omitted
}

The main class for parsing

Fields

extra: Vec<String>

Any extra arguments that were passed, but not parsed

Implementations

impl ArgParser[src]

pub fn new(name: &str) -> Self[src]

Creates a new ArgParser, with . Creates help and version args by default

pub fn author(&mut self, s: &str) -> &mut Self[src]

Sets the author

pub fn version(&mut self, s: &str) -> &mut Self[src]

Sets the version

pub fn copyright(&mut self, s: &str) -> &mut Self[src]

Sets the copyright

pub fn info(&mut self, s: &str) -> &mut Self[src]

Sets the info

pub fn usage(&mut self, s: &str) -> &mut Self[src]

Sets the usage

pub fn require_args(&mut self, b: bool) -> &mut Self[src]

Sets whether the program needs arguments or not

pub fn args(&mut self, args: Vec<&mut Arg>) -> &mut Self[src]

Adds the Vec<&mut Arg> to the parser’s args

pub fn get_str(&self, name: &str) -> String[src]

Gets a String value arg by . If no arg is found, default to String::new()

pub fn get_bool(&self, name: &str) -> bool[src]

Gets a bool value arg by . If no arg is found, default to false

pub fn parse(&mut self) -> &mut Self[src]

Parse with env::args()

pub fn parse_vec(&mut self, args: Vec<String>) -> &mut Self[src]

Parses a given Vec

Trait Implementations

impl Clone for ArgParser[src]

impl Debug for ArgParser[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.