#compdef uu-pr

autoload -U is-at-least

_uu-pr() {
    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[@]}" : \
'--pages=[pr-help-pages]:FIRST_PAGE[:LAST_PAGE]:_default' \
'-h+[pr-help-header]:STRING:_default' \
'--header=[pr-help-header]:STRING:_default' \
'-D+[pr-help-date-format]:FORMAT:_default' \
'--date-format=[pr-help-date-format]:FORMAT:_default' \
'-n+[pr-help-number-lines]:[char][width]:_default' \
'--number-lines=[pr-help-number-lines]:[char][width]:_default' \
'-N+[pr-help-first-line-number]:NUMBER:_default' \
'--first-line-number=[pr-help-first-line-number]:NUMBER:_default' \
'-l+[pr-help-page-length]:PAGE_LENGTH:_default' \
'--length=[pr-help-page-length]:PAGE_LENGTH:_default' \
'-w+[pr-help-column-width]:width:_default' \
'--width=[pr-help-column-width]:width:_default' \
'-W+[pr-help-page-width]:width:_default' \
'--page-width=[pr-help-page-width]:width:_default' \
'--column=[pr-help-column]:column:_default' \
'-s+[pr-help-column-char-separator]:char:_default' \
'--separator=[pr-help-column-char-separator]:char:_default' \
'-S+[pr-help-column-string-separator]:string:_default' \
'--sep-string=[pr-help-column-string-separator]:string:_default' \
'-o+[pr-help-indent]:margin:_default' \
'--indent=[pr-help-indent]:margin:_default' \
'-d[pr-help-double-space]' \
'--double-space[pr-help-double-space]' \
'-t[pr-help-omit-header]' \
'--omit-header[pr-help-omit-header]' \
'-r[pr-help-no-file-warnings]' \
'--no-file-warnings[pr-help-no-file-warnings]' \
'-F[pr-help-form-feed]' \
'--form-feed[pr-help-form-feed]' \
'-a[pr-help-across]' \
'--across[pr-help-across]' \
'-m[pr-help-merge]' \
'--merge[pr-help-merge]' \
'-J[pr-help-join-lines]' \
'--help[pr-help-help]' \
'-V[Print version]' \
'--version[Print version]' \
'::files:_files' \
&& ret=0
}

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

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