mirror of https://github.com/MedzikUser/imgurs
cli completions use match instead of if
This commit is contained in:
parent
bd3ef20a7f
commit
62531904f9
|
@ -76,16 +76,13 @@ pub async fn parse(client: ImgurHandle) {
|
||||||
Commands::Completions { shell } => {
|
Commands::Completions { shell } => {
|
||||||
let mut app = Cli::into_app();
|
let mut app = Cli::into_app();
|
||||||
|
|
||||||
if shell == "bash" {
|
match shell.as_str() {
|
||||||
print_completions(Shell::Bash, &mut app);
|
"bash" => print_completions(Shell::Bash, &mut app),
|
||||||
} else if shell == "zsh" {
|
"zsh" => print_completions(Shell::Zsh, &mut app),
|
||||||
print_completions(Shell::Zsh, &mut app);
|
"fish" => print_completions(Shell::Fish, &mut app),
|
||||||
} else if shell == "fish" {
|
"powershell" => print_completions(Shell::PowerShell, &mut app),
|
||||||
print_completions(Shell::Fish, &mut app);
|
|
||||||
} else if shell == "powershell" {
|
_ => error!("Completions to shell `{shell}`, not found!")
|
||||||
print_completions(Shell::PowerShell, &mut app);
|
|
||||||
} else {
|
|
||||||
error!("Completions to shell `{shell}`, not found!")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue