diff --git a/pkg/command/arguments.go b/pkg/command/arguments.go index 4ba54ac..3facf2e 100644 --- a/pkg/command/arguments.go +++ b/pkg/command/arguments.go @@ -127,7 +127,7 @@ func (args *Arguments) CompletionFunction(cc *cobra.Command, provided []string, values = cobra.AppendActiveHelp(values, arg.Description) } - if toComplete != "" { + if toComplete != "" && directive != cobra.ShellCompDirectiveFilterFileExt && directive != cobra.ShellCompDirectiveFilterDirs { filtered := []string{} for _, value := range values { if strings.HasPrefix(value, toComplete) { diff --git a/pkg/command/options.go b/pkg/command/options.go index 0f69a9f..ee0d96e 100644 --- a/pkg/command/options.go +++ b/pkg/command/options.go @@ -174,7 +174,7 @@ func (opt *Option) CompletionFunction(cmd *cobra.Command, args []string, toCompl return values, cobra.ShellCompDirectiveError } - if toComplete != "" { + if toComplete != "" && flag != cobra.ShellCompDirectiveFilterFileExt && flag != cobra.ShellCompDirectiveFilterDirs { filtered := []string{} for _, value := range values { if strings.HasPrefix(value, toComplete) {