pub fn validate(getopt: getopt) -> Result<getopt>Expand description
Validate parsed options in strict mode.
§Success
If strict mode validation passes, unchanged argument wrapped in Result
is returned.
§Errors
Returns Err if option not listed in optstring is encountered or
required argument for an option is missing.
§Example
use std::env::args;
use getopt3::hideBin;
let rc = getopt3::new(hideBin(args()), "ab:c");
if let Ok(g) = rc {
// command line parsed sucessfully
// validate options for missing arguments
if let Ok(g) = getopt3::validate(g) {
// command arguments are valid, we can use them
if let Some(_) = g.get('b') {
// -a option found on command line
};
};
};