Trait shell_completion::CompletionInput
source · pub trait CompletionInput: Sized {
fn args(&self) -> Vec<&str>;
fn arg_index(&self) -> usize;
fn char_index(&self) -> usize;
fn current_word(&self) -> &str { ... }
fn previous_word(&self) -> &str { ... }
fn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>
where
T: IntoIterator<Item = &'a str>,
{ ... }
fn complete_directory(&self) -> Vec<String> { ... }
fn complete_file(&self) -> Vec<String> { ... }
}
Required Methods§
fn args(&self) -> Vec<&str>
fn arg_index(&self) -> usize
fn char_index(&self) -> usize
Provided Methods§
fn current_word(&self) -> &str
fn previous_word(&self) -> &str
sourcefn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>where
T: IntoIterator<Item = &'a str>,
fn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>where
T: IntoIterator<Item = &'a str>,
Given a list of subcommands, print any that match the current word
sourcefn complete_directory(&self) -> Vec<String>
fn complete_directory(&self) -> Vec<String>
Print directory completions based on the current word
sourcefn complete_file(&self) -> Vec<String>
fn complete_file(&self) -> Vec<String>
Print file completions based on the current word Also returns directories because the user may be entering a file within that directory