Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
Disable auth for cobra shell request completion hidden commands
Browse files Browse the repository at this point in the history
Those hidden command are used by the shell completion scripts, but they
are not disabled auth check. Thus, the shell completion does not work
even the completion setup was done properly.
  • Loading branch information
abdfnx committed Aug 30, 2021
1 parent dc075a3 commit cc86821
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cmdutil/auth_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ func CheckAuth(cfg config.Config) bool {
}

func IsAuthCheckEnabled(cmd *cobra.Command) bool {
if cmd.Name() == "help" {
return false
switch cmd.Name() {
case "help", cobra.ShellCompRequestCmd, cobra.ShellCompNoDescRequestCmd:
return false
}

for c := cmd; c.Parent() != nil; c = c.Parent() {
Expand Down

0 comments on commit cc86821

Please sign in to comment.