diff --git a/pkg/util/autocomplete/autocomplete.go b/pkg/util/autocomplete/autocomplete.go index 7f0e0c1b..1343c30a 100644 --- a/pkg/util/autocomplete/autocomplete.go +++ b/pkg/util/autocomplete/autocomplete.go @@ -2,7 +2,6 @@ package autocomplete import ( "fmt" - "os" "github.com/spf13/cobra" ) @@ -48,13 +47,13 @@ func Command(name string) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { switch args[0] { case "bash": - _ = cmd.Root().GenBashCompletion(os.Stdout) + _ = cmd.Root().GenBashCompletion(cmd.OutOrStdout()) case "zsh": - _ = cmd.Root().GenZshCompletion(os.Stdout) + _ = cmd.Root().GenZshCompletion(cmd.OutOrStdout()) case "fish": - _ = cmd.Root().GenFishCompletion(os.Stdout, true) + _ = cmd.Root().GenFishCompletion(cmd.OutOrStdout(), true) case "powershell": - _ = cmd.Root().GenPowerShellCompletion(os.Stdout) + _ = cmd.Root().GenPowerShellCompletion(cmd.OutOrStdout()) } }, }