# bash completion for zopfli -*- shell-script -*- proc _zopfli { var cur = '', prev = '', words = '', cword = '' _init_completion || return match $prev { with -h return } if [[ "$cur" == -* ]] { setglobal COMPREPLY = '( '$( compgen -W \ '$( _parse_help "$1" -h | sed -e "s/#$//" )' -- "$cur" ) ) [[ $COMPREPLY == --i ]] && compopt -o nospace return } var IFS = '$'\n',' xspec = '"*.@(gz|t[ag]z)'" _expand || return 0 compopt -o filenames setglobal COMPREPLY = '( '$( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && complete -F _zopfli zopfli # ex: ts=4 sw=4 et filetype=sh