#compdef imgvwr

autoload -U is-at-least

_imgvwr() {
    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[@]}" : \
'--completions=[Print a shell completion script to stdout and exit]:SHELL:(bash zsh fish nushell)' \
'--config=[]:PATH:_files' \
'-d+[]::DECORATIONS:(true false)' \
'--decorations=[]::DECORATIONS:(true false)' \
'-a+[]::ANTIALIASING:(true false)' \
'--antialiasing=[]::ANTIALIASING:(true false)' \
'--min-scale=[]:MIN_SCALE:_default' \
'--max-scale=[]:MAX_SCALE:_default' \
'--scale-step=[]:SCALE_STEP:_default' \
'--filter-method=[]:FILTER_METHOD:(nearest triangle catmull-rom gaussian lanczos3)' \
'--log-level=[]:LOG_LEVEL:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths:_files' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_imgvwr" ]; then
    _imgvwr "$@"
else
    compdef _imgvwr imgvwr
fi
