pub fn parse_required<'a>(args: &'a ArgMatches, name: &str) -> Result<&'a str, Error> {
	let arg = args.value_of(name);
	match arg {
		Some(ar) => Ok(ar),
		None => {
			let msg = format!("Value for argument '{}' is required in this context", name,);
			Err(ErrorKind::ArgumentError(msg).into())
		}
	}
}
// parses a required value, or throws error with message otherwise
parses a required value, or throws error with message otherwise
parses a required value or throws error with message otherwise
pub fn parse_required<'a>(args: &'a ArgMatches, name: &str) -> Result<&'a str, Error> {
	let arg = args.value_of(name);
	match arg {
		Some(ar) => Ok(ar),
		None => {
			let msg = format!("Value for argument '{}' is required in this context", name,);
			Err(ErrorKind::ArgumentError(msg).into())
		}
	}
}
pub fn parse_required < ' a > ( args : & ' a ArgMatches , name : & str ) -> Result < & ' a str , Error > { let arg = args . value_of ( name ) ; match arg { Some ( ar ) => Ok ( ar ) , None => { let msg = format ! ( " " name ) ; Err ( ErrorKind :: ArgumentError ( msg ) . into ( ) ) } } }
parses a required value, or throws error with message otherwise
parses a required value or throws error with message otherwise
args
&'a ArgMatches
name
&str