# .zcomp
# modified by kent.

compctl -f -x 'p[2]' -g '*.lzh' + -g '*(-/)' -- lha
compctl -f -x 'p[2]' -g '*.zip' + -g '*(-/)' -- zip
compctl -f -x 'p[1] , W[1,-[ltv]] p[2]' -g '*.zip' + -g '*(-/)' -- unzip
compctl -g '*.gif' + -g '*(-/)' giftoppm
compctl -g '*.pbm' + -g '*(-/)' pbmlife pbmmake pbmmask pbmreduce pbmtext pbmto10x pbmtoascii pbmtoatk pbmtobbnbg pbmtocmuwm pbmtoepson pbmtog3 pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp pbmtomgr pbmtopi3 pbmtoplot pbmtoptx pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc pbmupc
compctl -g '*.pgm' + -g '*(-/)' pgmbentley pgmcrater pgmedge pgmenhance pgmhist pgmnorm pgmoil pgmramp pgmtexture pgmtofits pgmtofs pgmtolispm pgmtopbm pgmtoppm
compctl -g '*.pnm' + -g '*(-/)' pnmarith pnmcat pnmconvol pnmcrop pnmcut pnmdepth pnmenlarge pnmfile pnmflip pnmgamma pnminvert pnmnoraw pnmpaste pnmrotate pnmscale pnmshear pnmtile pnmtops pnmtorast pnmtotiff pnmtoxwd
compctl -g '*.ppm' + -g '*(-/)' ppmdither ppmforge ppmhist ppmmake ppmpat ppmquant ppmrelief ppmtoacad ppmtogif ppmtoicr ppmtoilbm ppmtopcx ppmtopgm ppmtopi1 ppmtopict ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel ppmtotga ppmtouil ppmtoxpm ppmtoyuv
compctl -g '*.{tiff,tif}' + -g '*(-/)' tifftopnm
compctl -g '*.xbm' + -g '*(-/)' xbmtopbm
#compctl -g '*.xpm' + -g '*(-/)' xpmtoppm
#compctl -g '*.xwd' + -g '*(-/)' xwdtopnm
compctl -g '*.mag *.pi *.pic *.mki *.ppm *.pbm *.ml1 *.beta' + -g '*(-/)' coerce
compctl -g '*.rcp *.r36' + -g '*(-/)' rcptomid
compctl -g '*.mid' + -g '*(-/)' smf1to0

# Rmdir only real directories
compctl -g '*(/)' rmdir dircmp

# Strip, profile, and debug only executables.  The compctls for the
# debuggers could be better, of course.
compctl -g '*(*)' strip gprof db gdb

# See the func/cdmatch function in the distribution
compctl -K cdmatch -S '/' -x 'S[/][~]' -g '*(-/)' -- cd pushd

compctl -l '' -x 'p[1]' -B -- builtin

# gzip files, but gzip -d only gzipped or compressed files
compctl -f -x 'R[-*d,^*]' -g '*.gz *.z *.Z *.tgz' + -g '*(-/)' -- gzip
compctl -g '*.gz *.z *.Z *.tgz' + -g '*(-/)' gunzip zcat

# Default completion.  See func/multicomp
compctl -D -f + -U -K multicomp
compctl -f -x 'C[-1,*f*] p[2]' -g "*.tar" -- tar

# Some builtins.
#compctl -j -P % fg bg wait jobs disown
compctl -A shift
compctl -caF type whence which
compctl -F unfunction
compctl -a unalias
compctl -v unset typeset declare vared readonly export integer
compctl -e disable
compctl -d enable
compctl -k '(cputime filesize datasize stacksize coredumpsize resident \
  memoryuse memorylocked descriptors openfiles vmemorysize)' limit ulimit
compctl -l '' -x 'p[1]' -f -- . source
