Merge pull request #131586 from ardaguclu/kuberc-completion

Continue alias creation when __completion is used to enable completion
This commit is contained in:
Kubernetes Prow Robot
2025-05-04 22:21:56 -07:00
committed by GitHub

View File

@@ -194,7 +194,7 @@ func (p *Preferences) applyAliases(rootCmd *cobra.Command, kuberc *config.Prefer
var commandName string // first "non-flag" arguments
var commandIndex int
for index, arg := range args[1:] {
if !strings.HasPrefix(arg, "-") {
if !strings.HasPrefix(arg, "-") && !strings.HasPrefix(arg, cobra.ShellCompRequestCmd) {
commandName = arg
commandIndex = index + 1
break