#compdef cattail

autoload -U is-at-least

_cattail() {
    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[@]}" : \
'-n+[Number of backlog lines to print per startup-resolved file]:N:_default' \
'--lines=[Number of backlog lines to print per startup-resolved file]:N:_default' \
'--interval-ms=[Polling interval in milliseconds for recovery scans and file reopen checks]:MS:_default' \
'--prefix=[How to label each output line]:PREFIX:(basename relative full)' \
'--color=[Colorize line prefixes when writing to an interactive terminal]:COLOR:(auto always never)' \
'--since-now[Skip the backlog and only emit lines appended after startup]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::inputs -- One or more file paths or glob patterns:_default' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_cattail" ]; then
    _cattail "$@"
else
    compdef _cattail cattail
fi
