mirror of https://github.com/spf13/cobra.git
Use readline's default filename completion if completion fails
If the `compspec` generates no matches it uses bash filename completion instead.
This commit is contained in:
parent
b3f29e98e6
commit
c6399cd398
|
@ -235,9 +235,9 @@ func postscript(out *bytes.Buffer, name string) {
|
||||||
|
|
||||||
`, name)
|
`, name)
|
||||||
fmt.Fprintf(out, `if [[ $(type -t compopt) = "builtin" ]]; then
|
fmt.Fprintf(out, `if [[ $(type -t compopt) = "builtin" ]]; then
|
||||||
complete -F __start_%s %s
|
complete -o default -F __start_%s %s
|
||||||
else
|
else
|
||||||
complete -o nospace -F __start_%s %s
|
complete -o default -o nospace -F __start_%s %s
|
||||||
fi
|
fi
|
||||||
|
|
||||||
`, name, name, name, name)
|
`, name, name, name, name)
|
||||||
|
|
Loading…
Reference in New Issue