Make sure to handle errors when generating completions
This commit is contained in:
parent
48ffd5aa00
commit
6424e8c92a
1 changed files with 3 additions and 4 deletions
|
|
@ -33,14 +33,13 @@ When installing with Homebrew, see https://docs.brew.sh/Shell-Completion
|
|||
|
||||
switch shellType {
|
||||
case "bash":
|
||||
RootCmd.GenBashCompletion(cmd.OutOrStdout())
|
||||
return RootCmd.GenBashCompletion(cmd.OutOrStdout())
|
||||
case "zsh":
|
||||
RootCmd.GenZshCompletion(cmd.OutOrStdout())
|
||||
return RootCmd.GenZshCompletion(cmd.OutOrStdout())
|
||||
case "fish":
|
||||
cobrafish.GenCompletion(RootCmd, cmd.OutOrStdout())
|
||||
return cobrafish.GenCompletion(RootCmd, cmd.OutOrStdout())
|
||||
default:
|
||||
return fmt.Errorf("unsupported shell type %q", shellType)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue