Skip to content

Commit 893486d

Browse files
authored
Merge pull request kubernetes#131586 from ardaguclu/kuberc-completion
Continue alias creation when __completion is used to enable completion
2 parents c87ed89 + f6d0498 commit 893486d

File tree

1 file changed

+1
-1
lines changed
  • staging/src/k8s.io/kubectl/pkg/kuberc

1 file changed

+1
-1
lines changed

staging/src/k8s.io/kubectl/pkg/kuberc/kuberc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (p *Preferences) applyAliases(rootCmd *cobra.Command, kuberc *config.Prefer
194194
var commandName string // first "non-flag" arguments
195195
var commandIndex int
196196
for index, arg := range args[1:] {
197-
if !strings.HasPrefix(arg, "-") {
197+
if !strings.HasPrefix(arg, "-") && !strings.HasPrefix(arg, cobra.ShellCompRequestCmd) {
198198
commandName = arg
199199
commandIndex = index + 1
200200
break

0 commit comments

Comments
 (0)