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ä ] [ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3. * 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 * Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions. filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions. * Add "short" tarball extensions to unxz, unlzma etc completions.

View File

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