[][src]Function lib::terminal::arg_exists

pub fn arg_exists(arg: String) -> bool

Parse the command line arguments for key / value pairs and check if one with the supplied key exists

The following argument formats are recognised:

--key value
-key value

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

Example

// Match against boolean result
match driscoll::io::arg_exists("test".to_string()) {

    true => println!("key exists"),
    false => println!("key does not exist")
}

// Simple boolean test
if driscoll::io::arg_exists("test".to_string()) {

    // Key exists
}