#  Copyright (C) 2003 Ingo K"ohne
#  
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

. ../include/common

for cmd in gzip gunzip
do
    optcomplete  $cmd ascii a
    optcomplete  $cmd to-stdout stdout c
    optcomplete  $cmd f force
    optcomplete  $cmd h help
    optcomplete  $cmd list l
    optcomplete  $cmd license L
    optcomplete  $cmd no-name n
    optcomplete  $cmd name N
    optcomplete  $cmd quiet q
    optcomplete  $cmd recursive r
    optcomplete -V suff -C : $cmd S suffix
    optcomplete  $cmd test t
    optcomplete  $cmd verbose v
    optcomplete  $cmd version V

    optcomplete -m long,getoptparse,getoptstop  $cmd
    complete -F xpcompfunc $cmd
done

cmd=gzip

optcomplete  $cmd 1 2 3 4 5 6 7 8 9 fast best
optcomplete -V d  $cmd d decompress uncompress
optcomplete -C '
XPC_suff=${XPC_suff%%[^[:alnum:]]*}
compgen -f -- "$XPC_PATTERN" | grep -e "${XPC_d:+${XPC_suff:-.\(tgz\|gz\|z\|Z\)}}$"
compgen -d -- "$XPC_PATTERN" #'  $cmd NONOPT

cmd=gunzip

optcomplete -C '
XPC_suff=${XPC_suff%%[^[:alnum:]]*}
compgen -f -- "$XPC_PATTERN" | grep -e "${XPC_suff:-.\(tgz\|gz\|z\|Z\)}$"
compgen -d -- "$XPC_PATTERN" #'  $cmd NONOPT


unset cmd ${!xpc_*}
