blob: c2fc2344f2c993c00571184404d3006648284e7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use cli_utils::string_vec;
use crate::systems::comp::context::CompletionContext;
pub fn comp(ctx: CompletionContext) -> Option<Vec<String>> {
if ctx.all_words.contains(&"--insert".to_string()) {
if ctx.all_words.len() > 7 {
return None;
}
} else if ctx.all_words.len() > 5 {
return None;
}
if ctx.current_word.starts_with('-') {
return Some(string_vec![
"-i", "--insert", "-q", "--query", "-e", "--erase", "--to",
]);
}
if ctx.previous_word == "--to" {
return Some(vec![]);
}
return None;
}
|