From b0f5f0c0aaff17cc2b462be40a4d211204ad571d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20G=C3=BC=C3=A7l=C3=BC?= Date: Fri, 2 May 2025 13:23:22 +0300 Subject: [PATCH] Continue alias creation when __completion is used to enable completion Kubernetes-commit: f6d0498017fc71c72891ad9455c4391aa63c6e71 --- pkg/kuberc/kuberc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kuberc/kuberc.go b/pkg/kuberc/kuberc.go index 03c6a2ef9..ecd02ee0f 100644 --- a/pkg/kuberc/kuberc.go +++ b/pkg/kuberc/kuberc.go @@ -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