pub fn match_error(&self, invocation: &VerbInvocation) -> Option<String> {
        match (&invocation.args, &self.args_parser) {
            (None, None) => None,
            (None, Some(ref regex)) => {
                if regex.is_match("") {
                    None
                } else {
                    Some(self.invocation.to_string_for_key(&invocation.key))
                }
            }
            (Some(ref s), Some(ref regex)) => {
                if regex.is_match(&s) {
                    None
                } else {
                    Some(self.invocation.to_string_for_key(&invocation.key))
                }
            }
            (Some(_), None) => Some(format!("{} doesn't take arguments", invocation.key)),
        }
    }
/// Assuming the verb has been matched, check whether the arguments
/// are OK according to the regex. Return none when there's no problem
/// and return the error to display if arguments don't match
Assuming the verb has been matched, check whether the arguments
are OK according to the regex. Return none when there's no problem
and return the error to display if arguments don't match
Assuming the verb has been matched check whether the arguments are OK according to the regex . Return none when there ' s no problem and return the error to display if arguments don ' t match
pub fn match_error(&self, invocation: &VerbInvocation) -> Option<String> {
        match (&invocation.args, &self.args_parser) {
            (None, None) => None,
            (None, Some(ref regex)) => {
                if regex.is_match("") {
                    None
                } else {
                    Some(self.invocation.to_string_for_key(&invocation.key))
                }
            }
            (Some(ref s), Some(ref regex)) => {
                if regex.is_match(&s) {
                    None
                } else {
                    Some(self.invocation.to_string_for_key(&invocation.key))
                }
            }
            (Some(_), None) => Some(format!("{} doesn't take arguments", invocation.key)),
        }
    }
pub fn match_error ( & self , invocation : & VerbInvocation ) -> Option < String > { match ( & invocation . args , & self . args_parser ) { ( None , None ) => None , ( None , Some ( ref regex ) ) => { if regex . is_match ( " " ) { None } else { Some ( self . invocation . to_string_for_key ( & invocation . key ) ) } } ( Some ( ref s ) , Some ( ref regex ) ) => { if regex . is_match ( & s ) { None } else { Some ( self . invocation . to_string_for_key ( & invocation . key ) ) } } ( Some ( _ ) , None ) => Some ( format ! ( " " invocation key ) ) , } }
Assuming the verb has been matched, check whether the arguments
are OK according to the regex.
Assuming the verb has been matched check whether the arguments are OK according to the regex .
&self
invocation
&VerbInvocation
&self
invocation
&VerbInvocation