mirror of
https://github.com/spf13/cobra
synced 2025-01-30 15:36:47 +00:00
Be more explicit about the default ShellCompDirective
This commit is contained in:
parent
440c33b3b3
commit
33e3ac194f
1 changed files with 7 additions and 1 deletions
|
@ -454,7 +454,13 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
|
|||
return finalCmd, completions, directive, nil
|
||||
}
|
||||
} else {
|
||||
directive = finalCmd.CompletionOptions.DefaultShellCompDirective
|
||||
customShellCompDirective := finalCmd.CompletionOptions.DefaultShellCompDirective
|
||||
if customShellCompDirective != ShellCompDirectiveDefault {
|
||||
directive = customShellCompDirective
|
||||
} else {
|
||||
directive = ShellCompDirectiveDefault
|
||||
}
|
||||
|
||||
if flag == nil {
|
||||
foundLocalNonPersistentFlag := false
|
||||
// If TraverseChildren is true on the root command we don't check for
|
||||
|
|
Loading…
Reference in a new issue