Do file completion after gendiff output redirection.

Common use case is "gendiff DIR EXTENSION > FILE".
This commit is contained in:
Ville Skyttä 2011-02-07 20:59:01 +02:00
parent c3a4f83bfd
commit d066ace4cb
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,8 @@
bash-completion (2.x)
[ Ville Skyttä ]
* Improve gendiff completion.
-- David Paleino <d.paleino@gmail.com> Sun, 06 Feb 2011 21:46:37 +0100
bash-completion (1.3)

View File

@ -294,9 +294,13 @@ have gendiff &&
_gendiff()
{
COMPREPLY=()
local cur cword
_get_comp_words_by_ref cur cword
[[ $cword != 1 ]] || _filedir -d
local cur prev cword
_get_comp_words_by_ref cur prev cword
if [[ $cword -eq 1 ]]; then
_filedir -d
elif [[ $prev == *\> ]]; then
_filedir
fi
} &&
complete -F _gendiff gendiff