Struct rargsxd::ArgParser[][src]

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

Main parser struct.

Fields

extra: Vec<String>

Implementations

impl ArgParser[src]

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

Parses std::env::args().

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

Parses a given Vec.

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

Gets an option argument’s output by name.

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

Gets a flag argument’s output by name.

pub fn get_word(&self, name: &str) -> Option<WordType>[src]

Gets a word argument’s output by name.

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

Creates a new ArgParser with name &str.

pub fn print_help(&self)[src]

Prints the help dialog.

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

Sets the name of the program.

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

Sets the name of the author of the program.

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

Sets the version of the program.

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

Sets the copyright (if any) of the program.

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

Sets the info of the program.

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

Sets the usage of the program.

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

Gives the parser args Vec<&mut Arg>.

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

Sets whether or not the program should exit when no arguments are passed.

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, 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.