Add compgen completion.

This commit is contained in:
Ville Skyttä 2010-09-14 21:04:36 +03:00
parent 806bc113de
commit 45668c23d3
2 changed files with 6 additions and 4 deletions

View File

@ -8,7 +8,8 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
* Add crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb completions.
* Add compgen, crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb
completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.

View File

@ -110,13 +110,14 @@ _complete()
if [[ "$cur" == -* ]]; then
# relevant options completion
COMPREPLY=( $( compgen -W '-a -b -c -d -e -f -g -j -k -o -s -v -u -A \
-G -W -P -S -X -F -C' -- "$cur" ) )
local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X"
[[ $1 != compgen ]] && opts="$opts -F -C"
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
else
COMPREPLY=( $( compgen -A command -- "$cur" ) )
fi
}
complete -F _complete complete
complete -F _complete compgen complete
# Local variables:
# mode: shell-script