skip filtering on completing dirs/files
This commit is contained in:
parent
db21a53b2d
commit
a14ffd07b9
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user