#compdef uu-join

autoload -U is-at-least

_uu-join() {
    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[@]}" : \
'*-a+[join-help-a]:FILENUM:(1 2)' \
'*-v+[join-help-v]:FILENUM:(1 2)' \
'-e+[join-help-e]:EMPTY:_default' \
'-j+[join-help-j]:FIELD:_default' \
'-o+[join-help-o]:FORMAT:_default' \
'-t+[join-help-t]:CHAR:_default' \
'-1+[join-help-1]:FIELD:_default' \
'-2+[join-help-2]:FIELD:_default' \
'-i[join-help-i]' \
'--ignore-case[join-help-i]' \
'--check-order[join-help-check-order]' \
'--nocheck-order[join-help-nocheck-order]' \
'--header[join-help-header]' \
'-z[join-help-z]' \
'--zero-terminated[join-help-z]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':file1:_files' \
':file2:_files' \
&& ret=0
}

(( $+functions[_uu-join_commands] )) ||
_uu-join_commands() {
    local commands; commands=()
    _describe -t commands 'uu-join commands' commands "$@"
}

if [ "$funcstack[1]" = "_uu-join" ]; then
    _uu-join "$@"
else
    compdef _uu-join uu-join
fi
