#compdef eqr

autoload -U is-at-least

_eqr() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" \
'*-o+[Output file (jpg/png/svg), print to console if not given]:OUTPUT:_files' \
'*--output=[Output file (jpg/png/svg), print to console if not given]:OUTPUT:_files' \
'*-l+[QR error correction level (L: 7%, M: 15%, Q: 25%, H: 30%)]:ERROR_CORRECTION_LEVEL:(L low M medium Q quartile H high)' \
'*--level=[QR error correction level (L: 7%, M: 15%, Q: 25%, H: 30%)]:ERROR_CORRECTION_LEVEL:(L low M medium Q quartile H high)' \
'*-e+[Edge size (in unit blocks)]:BORDER: ' \
'*--edge=[Edge size (in unit blocks)]:BORDER: ' \
'*-f+[Foreground RGB color (hex code)]:FG: ' \
'*--fg=[Foreground RGB color (hex code)]:FG: ' \
'*-b+[Background RGB color (hex code)]:BG: ' \
'*--bg=[Background RGB color (hex code)]:BG: ' \
'*-s+[Scale factor (1..255)]:SCALE: ' \
'*--scale=[Scale factor (1..255)]:SCALE: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'::string -- String to encode:' \
&& ret=0
}

(( $+functions[_eqr_commands] )) ||
_eqr_commands() {
    local commands; commands=()
    _describe -t commands 'eqr commands' commands "$@"
}

_eqr "$@"
