Parse pigz options from pigz, not gzip, option completion improvements.

This commit is contained in:
Ville Skyttä 2010-01-18 20:32:03 +02:00
parent 08e746ea10
commit 0b6baead5c
2 changed files with 12 additions and 5 deletions

View File

@ -25,9 +25,9 @@ bash-completion (2.x)
* Apply cardctl completion to pccardctl too. * Apply cardctl completion to pccardctl too.
* Apply pine completion to alpine too. * Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist. * Remove many unnecessary short option completions where long ones exist.
* Improve chsh, configure, cvs, gkrellm, lftp, look, mdadm, modprobe, mplayer, * Improve chsh, configure, cvs, gkrellm, gzip, lftp, look, mdadm, modprobe,
mysqladmin, rsync, screen, service, scp, ssh, sshfs, update-alternatives, mplayer, mysqladmin, rsync, screen, service, scp, ssh, sshfs,
vncviewer, yp-tools, and general hostname completions. update-alternatives, vncviewer, yp-tools, and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz. * Add abook and wtf completion, based on work by Raphaël Droz.
* Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake, * Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake,
pack200, unpack200, pbzip2, pbunzip2, pbzcat, pigz and unpigz completions. pack200, unpack200, pbzip2, pbunzip2, pbzcat, pigz and unpigz completions.

View File

@ -8,10 +8,17 @@ _gzip()
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
helpopts=`_parse_help gzip` helpopts=`_parse_help ${COMP_WORDS[0]}`
case $prev in
-b|--blocksize|-p|--processes|-S|--suffix|-h|--help|-V|--version)
return 0
;;
esac
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$helpopts -1 -2 -3 -4 -5 -6 -7 -8 -9" \
-- "$cur" ) )
return 0 return 0
fi fi