Struct foropts::Config
[−]
[src]
pub struct Config<'a, T> { /* fields omitted */ }
The configuration for the argument parser.
Parameters
<'a>
– The lifetime of the arguments’ actions
<T>
– The result type that each argument will be parsed into
Methods
impl<'a, T> Config<'a, T>
[src]
pub fn new<S: Into<String>>(name: S) -> Self
[src]
Creates a new foropts::Builder
given the name of the program.
pub fn name<S: Into<String>>(self, name: S) -> Self
[src]
Sets the program name.
pub fn version<S: Into<String>>(self, version: S) -> Self
[src]
Sets the version string.
[src]
Sets the author string.
pub fn about<S: Into<String>>(self, about: S) -> Self
[src]
Sets the description string.
pub fn arg_safe(&mut self, arg: Arg<'a, T>) -> Result<()>
[src]
Adds an argument to the list of arguments, returning Result::Err
if the
argument cannot be added.
pub fn arg(self, arg: Arg<'a, T>) -> Self
[src]
pub fn args<I: IntoIterator<Item = Arg<'a, T>>>(self, args: I) -> Self
[src]
ⓘImportant traits for Iter<'a, 'b, I, T>pub fn iter<'b, I: IntoIterator<Item = String>>(
&'b self,
args: I
) -> Iter<'b, 'a, I, T>
[src]
&'b self,
args: I
) -> Iter<'b, 'a, I, T>
Given an iterator over the unparsed arguments, returns an iterator over the parsed arguments.
pub fn exit_error(&self, error: &Error) -> !
[src]
Exits with an error message and usage information printed on stderr, with exit code 1.
pub fn exit_usage(&self) -> !
[src]
Prints usage information to stdout and exits with code 0.
pub fn exit_version(&self) -> !
[src]
Prints version information to stdout and exits with code 0.
pub fn write_version<W: Write>(&self, out: W) -> Result<()>
[src]
Writes version information to the given Write
.
pub fn write_usage<W: Write>(&self, out: W) -> Result<()>
[src]
Writes usage information to the given Write
.