pub fn complete_command(&self, tokens: Vec<String>) -> CompletionResult {
        if tokens.is_empty() {
            return complete_by_name("", &self.registered_commands);
        }

        let (commands, entry) = self.get_command_list(tokens);

        if commands.is_empty() {
            if entry.tokens.len() == 1 {
                return complete_by_name(&entry.tokens[0], &self.registered_commands);
            }
            return CompletionResult::NoMatches;
        }

        let command: &Command = commands.last().unwrap();
        if let Some(cb) = command.completion_callback {
            return (cb)(&entry);
        }

        CompletionResult::NoMatches
    }
// Return a CompletionResult that represents auto-completion suggestions for |tokens|.
Return a CompletionResult that represents auto-completion suggestions for |tokens|.
Return a CompletionResult that represents auto - completion suggestions for |tokens| .
pub fn complete_command(&self, tokens: Vec<String>) -> CompletionResult {
        if tokens.is_empty() {
            return complete_by_name("", &self.registered_commands);
        }
        let (commands, entry) = self.get_command_list(tokens);
        if commands.is_empty() {
            if entry.tokens.len() == 1 {
                return complete_by_name(&entry.tokens[0], &self.registered_commands);
            }
            return CompletionResult::NoMatches;
        }
        let command: &Command = commands.last().unwrap();
        if let Some(cb) = command.completion_callback {
            return (cb)(&entry);
        }
        CompletionResult::NoMatches
    }
pub fn complete_command ( & self , tokens : Vec < String > ) -> CompletionResult { if tokens . is_empty ( ) { return complete_by_name ( " " , & self . registered_commands ) ; } let ( commands , entry ) = self . get_command_list ( tokens ) ; if commands . is_empty ( ) { if entry . tokens . len ( ) == 1 { return complete_by_name ( & entry . tokens [ 0 ] , & self . registered_commands ) ; } return CompletionResult :: NoMatches ; } let command : & Command = commands . last ( ) . unwrap ( ) ; if let Some ( cb ) = command . completion_callback { return ( cb ) ( & entry ) ; } CompletionResult :: NoMatches }
Return a CompletionResult that represents auto-completion suggestions for |tokens|.
Return a CompletionResult that represents auto - completion suggestions for |tokens| .
&self
tokens
Vec<String>
&self
tokens
Vec<String>