#compdef sqopv

autoload -U is-at-least

_sqopv() {
    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[@]}" \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_sqopv_commands" \
"*::: :->sop" \
&& ret=0
    case $state in
    (sop)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sqopv-command-$line[1]:"
        case $line[1] in
            (version)
_arguments "${_arguments_options[@]}" \
'(--extended --sop-spec --sopv)--backend[Returns name and version of the primary underlying OpenPGP toolkit]' \
'(--backend --sop-spec --sopv)--extended[Returns multiple lines of name and version information]' \
'(--backend --extended --sopv)--sop-spec[Returns the latest version of the SOP spec that is implemented]' \
'(--backend --extended --sop-spec)--sopv[Returns "1.0\\n" if the sopv subset is implemented]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" \
'--not-before=[Consider signatures before this date invalid]:NOT_BEFORE: ' \
'--not-after=[Consider signatures after this date invalid]:NOT_AFTER: ' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
':signatures -- Signatures to verify:' \
'*::certs -- Certs for verification:' \
&& ret=0
;;
(inline-verify)
_arguments "${_arguments_options[@]}" \
'--not-before=[Consider signatures before this date invalid]:NOT_BEFORE: ' \
'--not-after=[Consider signatures after this date invalid]:NOT_AFTER: ' \
'--verifications-out=[Write verification result here]:VERIFICATIONS_OUT: ' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::certs -- Certs for verification:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_sqopv__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sqopv-help-command-$line[1]:"
        case $line[1] in
            (version)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(inline-verify)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_sqopv_commands] )) ||
_sqopv_commands() {
    local commands; commands=(
'version:Prints version information' \
'verify:Verifies Detached Signatures' \
'inline-verify:Verifies Inline-Signed Messages' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sqopv commands' commands "$@"
}
(( $+functions[_sqopv__help_commands] )) ||
_sqopv__help_commands() {
    local commands; commands=(
'version:Prints version information' \
'verify:Verifies Detached Signatures' \
'inline-verify:Verifies Inline-Signed Messages' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sqopv help commands' commands "$@"
}
(( $+functions[_sqopv__help__help_commands] )) ||
_sqopv__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help help commands' commands "$@"
}
(( $+functions[_sqopv__help__inline-verify_commands] )) ||
_sqopv__help__inline-verify_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help inline-verify commands' commands "$@"
}
(( $+functions[_sqopv__inline-verify_commands] )) ||
_sqopv__inline-verify_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv inline-verify commands' commands "$@"
}
(( $+functions[_sqopv__help__verify_commands] )) ||
_sqopv__help__verify_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help verify commands' commands "$@"
}
(( $+functions[_sqopv__verify_commands] )) ||
_sqopv__verify_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv verify commands' commands "$@"
}
(( $+functions[_sqopv__help__version_commands] )) ||
_sqopv__help__version_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help version commands' commands "$@"
}
(( $+functions[_sqopv__version_commands] )) ||
_sqopv__version_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv version commands' commands "$@"
}

if [ "$funcstack[1]" = "_sqopv" ]; then
    _sqopv "$@"
else
    compdef _sqopv sqopv
fi
