#compdef teeny

local curcontext="$curcontext"
typeset -A opt_args

local rc=1
_arguments -s -S \
{-h,--help}'[show this help message and exit]'\
{-r,--recursive}'[operate on all files in the specified path]'\
--glob'[operate on files matching this pattern]'\
{-v,--verbose}\
{-q,--quiet}\
{-p,--progress}'[show overall progress for recursive operations]'\
{-f,--format}'[Target file format. If "jpg", images with transparency will not be converted, but other formats will be. If "webp", any input image will be converted.]'\
{-k,--keep-format}'[Keep original format, only recompress]'\
{-F,--force-format}'[Convert to specified format whenever possible]'\
--quality'[Target JPEG/WEBP quality]':'<int>'\
--gif'[Convert animated GIFs to the specified format. mp4 and hevc will use hardware encoder if possible]'\
--res'[Limit minimum dimension to this value]':'<int>'\
--width'[Limit width to this value]':'<int>'\
--height'[Limit height to this value]':'<int>'\
--no-crush'[Do not optimize PNG images with transparency (lossless)]'\
--quantize'[Quantize PNG images with transparency (lossy)]'\
--threads'[Limit threads on subprocesses (ffmpeg and GM)]'\
--no-parallel'[Do not run conversions in parallel when running recursively.]' && rc=0

return rc
