Do not assume all --foo= options take filenames in generic long option completion, assume only that --*file*= does, and that --*dir*= takes dirs.

master
Ville Skyttä 2009-04-15 00:09:33 +03:00
parent bce0b30bbe
commit b556b22d87
2 changed files with 10 additions and 1 deletions

View File

@ -38,6 +38,8 @@ bash-completion (1.x)
generic long option completion.
* Add chown --from and --reference value completions.
* Add chgrp --reference value completion.
* Do not assume all --foo= options take filenames in generic long option
completion, assume only that --*file*= does, and that --*dir*= takes dirs.
[ Todd Zullinger ]
* Make yum complete on filenames after install, deplist, update and upgrade

View File

@ -4300,7 +4300,14 @@ _longopt()
prev=${COMP_WORDS[COMP_CWORD-1]}
if _split_longopt; then
_filedir
case "$prev" in
*[Dd][Ii][Rr]*)
_filedir -d
;;
*[Ff][Ii][Ll][Ee]*)
_filedir
;;
esac
return 0
fi