1use crate::Spec;
2
3mod bash;
4mod fish;
5mod zsh;
6
7pub struct CompleteOptions {
8 pub usage_bin: String,
9 pub shell: String,
10 pub bin: String,
11 pub cache_key: Option<String>,
12 pub spec: Option<Spec>,
13 pub usage_cmd: Option<String>,
14 pub include_bash_completion_lib: bool,
15 pub source_file: Option<String>,
16}
17
18pub fn complete(options: &CompleteOptions) -> String {
19 match options.shell.as_str() {
20 "bash" => bash::complete_bash(options),
21 "fish" => fish::complete_fish(options),
22 "zsh" => zsh::complete_zsh(options),
23 _ => unimplemented!("unsupported shell: {}", options.shell),
24 }
25}