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
commit 893486dfd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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