diff --git a/cmd/completion.go b/cmd/completion.go index a81f684..4e137b9 100644 --- a/cmd/completion.go +++ b/cmd/completion.go @@ -25,7 +25,7 @@ with shell name as argument, output completion for the shell to standard output. } switch args[0] { case "bash": - return rootCmd.GenBashCompletion(os.Stdout) + return rootCmd.GenBashCompletionV2(os.Stdout, false) case "fish": return rootCmd.GenFishCompletion(os.Stdout, false) case "zsh": diff --git a/internal/completion/completion.go b/internal/completion/completion.go index deea152..907f136 100644 --- a/internal/completion/completion.go +++ b/internal/completion/completion.go @@ -36,7 +36,7 @@ func makeBashCompletionFileIfNeeded(cmd *cobra.Command) { path := bashCompletionFilePath() bashCompletion := new(bytes.Buffer) - if err := cmd.GenBashCompletion(bashCompletion); err != nil { + if err := cmd.GenBashCompletionV2(bashCompletion, false); err != nil { print.Err(fmt.Errorf("can not generate bash completion content: %w", err)) return } @@ -167,7 +167,7 @@ func hasSameBashCompletionContent(cmd *cobra.Command) bool { } currentBashCompletion := new(bytes.Buffer) - if err := cmd.GenBashCompletion(currentBashCompletion); err != nil { + if err := cmd.GenBashCompletionV2(currentBashCompletion, false); err != nil { return false } if !strings.Contains(string(bashCompletionFileInLocal), currentBashCompletion.String()) {