mirror of
https://github.com/spf13/cobra
synced 2025-01-30 23:46:45 +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
|
return finalCmd, completions, directive, nil
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
directive = finalCmd.CompletionOptions.DefaultShellCompDirective
|
customShellCompDirective := finalCmd.CompletionOptions.DefaultShellCompDirective
|
||||||
|
if customShellCompDirective != ShellCompDirectiveDefault {
|
||||||
|
directive = customShellCompDirective
|
||||||
|
} else {
|
||||||
|
directive = ShellCompDirectiveDefault
|
||||||
|
}
|
||||||
|
|
||||||
if flag == nil {
|
if flag == nil {
|
||||||
foundLocalNonPersistentFlag := false
|
foundLocalNonPersistentFlag := false
|
||||||
// If TraverseChildren is true on the root command we don't check for
|
// If TraverseChildren is true on the root command we don't check for
|
||||||
|
|
Loading…
Reference in a new issue