diff --git a/completions.go b/completions.go index 0c5c2ec..b404322 100644 --- a/completions.go +++ b/completions.go @@ -454,11 +454,11 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi return finalCmd, completions, directive, nil } } else { + directive = ShellCompDirectiveDefault + customShellCompDirective := finalCmd.CompletionOptions.DefaultShellCompDirective if customShellCompDirective != ShellCompDirectiveDefault { directive = customShellCompDirective - } else { - directive = ShellCompDirectiveDefault } if flag == nil {