Struct abstutil::cli::CmdArgs [−][src]
pub struct CmdArgs { kv: HashMap<String, String>, bits: HashSet<String>, free: Vec<String>, used: HashSet<String>, }
Yet another barebones command-line flag parsing library.
Fields
kv: HashMap<String, String>
bits: HashSet<String>
free: Vec<String>
used: HashSet<String>
Implementations
impl CmdArgs
[src]
impl CmdArgs
[src]pub fn new() -> CmdArgs
[src]
On native, initialize with real flags. On web, transform URL query parameters into flags.
Calling this has the side-effect of initializing logging on both native and web. This should probably be done independently, but for the moment, every app wants both.
fn from_args(raw: Vec<String>) -> CmdArgs
[src]
pub fn required(&mut self, key: &str) -> String
[src]
pub fn optional(&mut self, key: &str) -> Option<String>
[src]
pub fn optional_parse<T, E, F: Fn(&str) -> Result<T, E>>(
&mut self,
key: &str,
parser: F
) -> Option<T>
[src]
&mut self,
key: &str,
parser: F
) -> Option<T>