#compdef uu-more

autoload -U is-at-least

_uu-more() {
    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[@]}" \
'-F+[Display file beginning from line number]:number: ' \
'--from-line=[Display file beginning from line number]:number: ' \
'-n+[The number of lines per screen full]:number: ' \
'--lines=[The number of lines per screen full]:number: ' \
'--number=[Same as --lines]: : ' \
'-c[Do not scroll, display text and clean line ends]' \
'--print-over[Do not scroll, display text and clean line ends]' \
'-d[Display help instead of ringing bell]' \
'--silent[Display help instead of ringing bell]' \
'-p[Do not scroll, clean screen and display text]' \
'--clean-print[Do not scroll, clean screen and display text]' \
'-s[Squeeze multiple blank lines into one]' \
'--squeeze[Squeeze multiple blank lines into one]' \
'-u[]' \
'--plain[]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::files -- Path to the files to be read:_files' \
&& ret=0
}

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

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