mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Fixed error handling
This commit is contained in:
parent
de8dcff803
commit
6777d639c0
@ -25,17 +25,13 @@ func createBashCompletionCmd(rootCmd *cobra.Command) *cobra.Command {
|
|||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
switch shellVariant {
|
switch shellVariant {
|
||||||
case "bash", "":
|
case "bash", "":
|
||||||
rootCmd.GenBashCompletion(os.Stdout)
|
return rootCmd.GenBashCompletion(os.Stdout)
|
||||||
return nil
|
|
||||||
case "zsh":
|
case "zsh":
|
||||||
rootCmd.GenZshCompletion(os.Stdout)
|
return rootCmd.GenZshCompletion(os.Stdout)
|
||||||
return nil
|
|
||||||
case "fish":
|
case "fish":
|
||||||
rootCmd.GenFishCompletion(os.Stdout, true)
|
return rootCmd.GenFishCompletion(os.Stdout, true)
|
||||||
return nil
|
|
||||||
case "powershell":
|
case "powershell":
|
||||||
rootCmd.GenPowerShellCompletion(os.Stdout)
|
return rootCmd.GenPowerShellCompletion(os.Stdout)
|
||||||
return nil
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unknown variant %v", shellVariant)
|
return fmt.Errorf("Unknown variant %v", shellVariant)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user