check completion errors

This commit is contained in:
2022-11-02 14:33:48 +01:00
parent 335b2665f2
commit c8bad4df1a

View File

@@ -49,18 +49,16 @@ func man() {
func completion(cmd *cobra.Command, mode string) error { func completion(cmd *cobra.Command, mode string) error {
switch mode { switch mode {
case "bash": case "bash":
cmd.Root().GenBashCompletion(os.Stdout) return cmd.Root().GenBashCompletion(os.Stdout)
case "zsh": case "zsh":
cmd.Root().GenZshCompletion(os.Stdout) return cmd.Root().GenZshCompletion(os.Stdout)
case "fish": case "fish":
cmd.Root().GenFishCompletion(os.Stdout, true) return cmd.Root().GenFishCompletion(os.Stdout, true)
case "powershell": case "powershell":
cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) return cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
default: default:
return errors.New("Invalid shell parameter! Valid ones: bash|zsh|fish|powershell") return errors.New("Invalid shell parameter! Valid ones: bash|zsh|fish|powershell")
} }
return nil
} }
func Execute() { func Execute() {