Created
February 15, 2017 06:33
-
-
Save oflow/4b70b8efdcd8dd43705b9a5c0868134b to your computer and use it in GitHub Desktop.
雑なzopfli補完
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compdef _zopfli zopfli | |
function _zopfli() { | |
_arguments \ | |
'-h[help]' \ | |
'-c[write the result on standard output]' \ | |
'-v[verbose mode]' \ | |
'--i#[perform # iterations (default 15). Expamples --i50]' \ | |
'--gzip[output to gzip format (default)]' \ | |
'--zlib[output to zlib format]' \ | |
'--deflate[output to deflate format]' \ | |
'--splitlast[do block splitting last instead of first]' \ | |
'*:key:__zopfli' | |
__zopfli() { | |
local -a iterations | |
if [ "$(echo "${words[@]}" | grep " --i")" ]; then | |
iterations=( | |
'--' | |
'--i15' | |
'--i20' | |
'--i50' | |
'--i100' | |
'--i200' | |
) | |
_wanted key expl 'iterations' compadd $iterations | |
else | |
_wanted key expl 'files' _files | |
fi | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment