Struct rargsxd::ArgParser [−][src]
pub struct ArgParser { pub name: String, pub author: String, pub version: String, pub copyright: String, pub info: String, pub usage: String, pub require_args: bool, pub extra: Vec<String>, // some fields omitted }
Expand description
The main class for parsing
Fields
name: String
The name of the program
The author of the program
version: String
The version of the program
copyright: String
Copyright string
info: String
Simple description of the program
usage: String
Example usage of the program
require_args: bool
Whether the program has to have arguments passed or not
extra: Vec<String>
Any extra arguments that were passed, but not parsed
Implementations
Creates a new ArgParser using the first argument (the program) as the name. Creates help and version args by default
Creates a new ArgParser, with
Sets the author
Sets the usage. Replaces all instances of {name} with the program’s name.
Sets whether the program needs arguments or not
Adds the Vec<&mut Arg> to the parser’s args
Returns a copy of the parser’s current arguments in HashMap form using the ArgVal struct
Returns a copy of the parser’s current arguments in HashMap form using tuples
Gets a String value arg by
Gets a bool value arg by
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ArgParser
impl UnwindSafe for ArgParser
Blanket Implementations
Mutably borrows from an owned value. Read more