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}
16
17pub fn complete(options: &CompleteOptions) -> String {
18 match options.shell.as_str() {
19 "bash" => bash::complete_bash(options),
20 "fish" => fish::complete_fish(options),
21 "zsh" => zsh::complete_zsh(options),
22 _ => unimplemented!("unsupported shell: {}", options.shell),
23 }
24}