Continue alias creation when __completion is used to enable completion

Kubernetes-commit: f6d0498017fc71c72891ad9455c4391aa63c6e71
This commit is contained in:
Arda Güçlü 2025-05-02 13:23:22 +03:00 committed by Kubernetes Publisher
parent 3323e167c5
commit b0f5f0c0aa
1 changed files with 1 additions and 1 deletions

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