[][src]Struct qargparser::Parser

pub struct Parser<C> { /* fields omitted */ }

The core parser.

Implementations

impl<C> Parser<C>[src]

pub fn from_env(ctx: C) -> Self[src]

Create a parser for parsing the process' command line arguments.

pub fn from_args<I, S>(argv0: &str, args: I, ctx: C) -> Self where
    I: IntoIterator<Item = S>,
    S: AsRef<str>, 
[src]

pub fn add(&mut self, spec: Spec<C>) -> Result<(), ErrKind<C>>[src]

pub fn get_arg0(&self) -> &str[src]

pub fn get_remaining_args(&mut self) -> Vec<String>[src]

pub fn have_capture_rest(&self) -> bool[src]

pub fn set_tophelp<I, S>(&mut self, p: I) where
    I: IntoIterator<Item = S>,
    S: ToString
[src]

pub fn append_tophelp<I, S>(&mut self, p: I) where
    I: IntoIterator<Item = S>,
    S: ToString
[src]

pub fn set_bottomhelp<I, S>(&mut self, p: I) where
    I: IntoIterator<Item = S>,
    S: ToString
[src]

pub fn append_bottomhelp<I, S>(&mut self, p: I) where
    I: IntoIterator<Item = S>,
    S: ToString
[src]

pub fn parse(&mut self) -> Result<Option<Rc<RefCell<Spec<C>>>>, ErrKind<C>>[src]

pub fn next(&mut self) -> Result<Option<Rc<RefCell<Spec<C>>>>, ErrKind<C>>[src]

pub fn num_remaining_args(&self) -> usize[src]

pub fn num_remaining_posargspecs(&self) -> usize[src]

pub fn validate(&self) -> Result<(), ErrKind<C>>[src]

pub fn usage(&self, out: &mut dyn Write)[src]

Print out help text for parser options.

Hidden options will not be displayed.

The overall format for the help text is:

Usage: <cmd> [options] [positional arguments]

[top help]

[options]

[positional arguments]

[bottom help]

pub fn print_usage(&self, out: &mut dyn Write)[src]

Print the "Usage" part of the help.

The output format is:

Usage: <command> [arguments] [positional arguments]

pub fn print_tophelp(&self, out: &mut dyn Write)[src]

pub fn print_bottomhelp(&self, out: &mut dyn Write)[src]

pub fn print_opts(&self, out: &mut dyn Write)[src]

Print the help section for "options". Options are arguments that have a short and/or long option name.

pub fn print_posargs(&self, out: &mut dyn Write)[src]

Print the help section for positional arguments.

pub fn did_fail(&self) -> bool[src]

pub fn get_ctx(&self) -> &C[src]

pub fn into_ctx(self) -> C[src]

Trait Implementations

impl<C> Iterator for Parser<C>[src]

type Item = Rc<RefCell<Spec<C>>>

The type of the elements being iterated over.

Auto Trait Implementations

impl<C> !RefUnwindSafe for Parser<C>[src]

impl<C> !Send for Parser<C>[src]

impl<C> !Sync for Parser<C>[src]

impl<C> Unpin for Parser<C> where
    C: Unpin
[src]

impl<C> !UnwindSafe for Parser<C>[src]

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.