Trait terminal_cli::CliCommand
[−]
[src]
pub trait CliCommand { fn execute(&mut self, cli: &mut CliTerminal, line: &str); fn is_match(&self, line: &str) -> bool; fn autocomplete(&self, line_start: &str) -> Option<Vec<AutocompleteOption>>; }
A command that can be executed by the execution function.
Required Methods
fn execute(&mut self, cli: &mut CliTerminal, line: &str)
Execute the command with the given line buffer
fn is_match(&self, line: &str) -> bool
Check if the line buffer is valid for this command
fn autocomplete(&self, line_start: &str) -> Option<Vec<AutocompleteOption>>
Give auto-complete hints
Implementors
impl<Fo> CliCommand for CliCommandKeyword<Fo> where Fo: Fn(&str, &mut CliTerminal) -> ()
impl<T, Fo, Fi> CliCommand for CliPropertyVar<T, Fo, Fi> where Fo: Fn(&T) -> String, Fi: Fn(&str) -> Option<T>
impl<Fo, Fi> CliCommand for CliPropertyFn<Fo, Fi> where Fo: Fn() -> String, Fi: Fn(&str, &mut CliTerminal)