#compdef zip2arx

autoload -U is-at-least

_zip2arx() {
    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+[Archive name to create]:OUTFILE:_files' \
'--outfile=[Archive name to create]:OUTFILE:_files' \
'-c+[Set compression algorithm to use]:COMPRESSION:_default' \
'--compression=[Set compression algorithm to use]:COMPRESSION:_default' \
'--generate-complete=[]:GENERATE_COMPLETE:(bash elvish fish powershell zsh)' \
'-1[Create only one file (default)]' \
'--one-file[Create only one file (default)]' \
'-2[Create two files (a content pack and other)]' \
'--two-files[Create two files (a content pack and other)]' \
'-N[Create mulitples files (one per pack)]' \
'--multiple-files[Create mulitples files (one per pack)]' \
'--list-compressions[List available compression algorithms]' \
'--generate-man-page[]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::zip_file -- Zip file to convert:_files' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_zip2arx" ]; then
    _zip2arx "$@"
else
    compdef _zip2arx zip2arx
fi
