[−][src]Function menu::argument_finder
pub fn argument_finder<'a, T>(
item: &'a Item<'a, T>,
argument_list: &'a [&'a str],
name_to_find: &'a str
) -> Result<Option<&'a str>, ()>
Looks for the named parameter in the parameter list of the item, then finds the correct argument.
- Returns
Ok(None)
ifparameter_name
gives an optional or named parameter and that argument was not given. - Returns
Ok(arg)
if the argument corresponding toparameter_name
was found.arg
is the empty string if the parameter wasParameter::Named
(and hence doesn't take a value). - Returns
Err(())
ifparameter_name
was not initem.parameter_list
oritem
wasn't an Item::Callback