[][src]Function lib::terminal::get_arg

pub fn get_arg(key: String) -> Result<String, ()>

Parse the command line arguments for key / value pairs and return one if it has the supplied key

The following argument formats are recognised:

--key value
-key value

--key=value
-key=value
key=value

Example

match driscoll::io::get_arg("test".to_string()) {

    Ok(content) => println!("Found: {}", content),
    Err(_) => println!("Not found")
}