Skip to content

Commit

Permalink
Pass all tests by using correct flagComp lookups in completion command
Browse files Browse the repository at this point in the history
code.
  • Loading branch information
maxlandon committed Nov 2, 2023
1 parent 340cb4c commit 69578f2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
// Find the completion function for the flag or command
var completionFn func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)
if flag != nil && flagCompletion {
c.initializeCompletionStorage()

finalCmd.flagCompletionMutex.RLock()
completionFn = finalCmd.flagCompletionFunctions[flag]
finalCmd.flagCompletionMutex.RUnlock()
completionFn, _ = finalCmd.GetFlagCompletion(flag)
} else {
completionFn = finalCmd.ValidArgsFunction
}
Expand Down

0 comments on commit 69578f2

Please sign in to comment.