#compdef pvverify

autoload -U is-at-least

_pvverify() {
    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[@]}" : \
'*-k+[Use FILE as a host-key document]:FILE:_files' \
'*--host-key-document=[Use FILE as a host-key document]:FILE:_files' \
'*-C+[Use FILE as a certificate to verify the host-key or keys]:FILE:_files' \
'*--cert=[Use FILE as a certificate to verify the host-key or keys]:FILE:_files' \
'*--crl=[Use FILE as a certificate revocation list (CRL)]:FILE:_files' \
'--root-ca=[Use FILE as the root-CA certificate for the verification]:ROOT_CA:_files' \
'--no-verify[Disable the host-key document verification]' \
'--offline[Make no attempt to download CRLs]' \
'--version[Print version information and exit]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_pvverify" ]; then
    _pvverify "$@"
else
    compdef _pvverify pvverify
fi
