#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
;;
(list-profiles)
_arguments "${_arguments_options[@]}" \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
':subcommand:' \
&& ret=0
;;
(generate-key)
_arguments "${_arguments_options[@]}" \
'--profile=[Select the profile to use for key generation]:PROFILE: ' \
'--with-key-password=[Protect the newly generated key with the given password]:WITH_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--signing-only[Create a signing-only key]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::userids -- UserIDs for the generated key:' \
&& ret=0
;;
(change-key-password)
_arguments "${_arguments_options[@]}" \
'--new-key-password=[The new password to lock the key with, or just unlock the key if the option is absent]:NEW_KEY_PASSWORD: ' \
'*--old-key-password=[Unlock the keys with these passwords]:OLD_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(revoke-key)
_arguments "${_arguments_options[@]}" \
'*--with-key-password=[Unlock the keys with these passwords]:WITH_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(extract-cert)
_arguments "${_arguments_options[@]}" \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(update-key)
_arguments "${_arguments_options[@]}" \
'*--with-key-password=[Unlock the keys with these passwords]:WITH_KEY_PASSWORD: ' \
'*--merge-certs=[Merge updates into the key]:MERGE_CERTS: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--signing-only[Don'\''t make the updated key encryption-capable if it isn'\''t already]' \
'--no-added-capabilities[Don'\''t advertise support for capabilities that aren'\''t already advertised by the key]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(merge-certs)
_arguments "${_arguments_options[@]}" \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::certs -- Merge updates into the certs:' \
&& ret=0
;;
(certify-userid)
_arguments "${_arguments_options[@]}" \
'*--userid=[Certify the specified user IDs]:USERID: ' \
'*--with-key-password=[Unlock the keys with these passwords]:WITH_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--no-require-self-sig[Don'\''t require self-signatures on the user IDs to be certified]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::keys -- Create certifications using these keys:' \
&& ret=0
;;
(validate-userid)
_arguments "${_arguments_options[@]}" \
'--validate-at=[Evaluate the validity of the User ID at the specified time, not at the current time]:VALIDATE_AT: ' \
'--addr-spec-only[Treat USERID as an e-mail address, and matched only against the e-mail address part of each correctly bound User ID]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
':userid -- The User ID to validate:' \
'*::certs -- Authority OpenPGP certificates, i.e. trust roots:' \
&& ret=0
;;
(sign)
_arguments "${_arguments_options[@]}" \
'--as=[Sign binary data or UTF-8 text]:AS: ' \
'--micalg-out=[Emit the digest algorithm used to the specified file]:MICALG_OUT: ' \
'*--with-key-password=[Try to decrypt the signing KEYS with these passwords]:WITH_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::keys -- Keys for signing:' \
&& 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
;;
(encrypt)
_arguments "${_arguments_options[@]}" \
'--profile=[Select the profile to use for encryption]:PROFILE: ' \
'--as=[Encrypt binary data or UTF-8 text]:AS: ' \
'*--with-password=[Encrypt with passwords]:WITH_PASSWORD: ' \
'*--sign-with=[Keys for signing]:SIGN_WITH: ' \
'*--with-key-password=[Try to decrypt the signing KEYS with these passwords]:WITH_KEY_PASSWORD: ' \
'--session-key-out=[Write the session key here]:SESSION_KEY_OUT: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::certs -- Encrypt for these certs:' \
&& ret=0
;;
(decrypt)
_arguments "${_arguments_options[@]}" \
'--session-key-out=[Write the session key here]:SESSION_KEY_OUT: ' \
'*--with-session-key=[Try to decrypt with this session key]:WITH_SESSION_KEY: ' \
'*--with-password=[Try to decrypt with this password]:WITH_PASSWORD: ' \
'--verifications-out=[Write verification result here]:VERIFICATIONS_OUT: ' \
'*--verify-with=[Certs for verification]:VERIFY_WITH: ' \
'--verify-not-before=[Consider signatures before this date invalid]:VERIFY_NOT_BEFORE: ' \
'--verify-not-after=[Consider signatures after this date invalid]:VERIFY_NOT_AFTER: ' \
'*--with-key-password=[Try to decrypt the encryption KEYS with these passwords]:WITH_KEY_PASSWORD: ' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::keys -- Try to decrypt with these keys:' \
&& ret=0
;;
(armor)
_arguments "${_arguments_options[@]}" \
'--label=[Indicates the kind of data]:LABEL: ' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(dearmor)
_arguments "${_arguments_options[@]}" \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(inline-detach)
_arguments "${_arguments_options[@]}" \
'--signatures-out=[Write Signatures here]:SIGNATURES_OUT: ' \
'--no-armor[Don'\''t ASCII-armor the signatures]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
&& 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
;;
(inline-sign)
_arguments "${_arguments_options[@]}" \
'--as=[Sign binary data, UTF-8 text, or using the Cleartext Signature Framework]:AS: ' \
'*--with-key-password=[Try to decrypt the signing KEYS with these passwords]:WITH_KEY_PASSWORD: ' \
'--no-armor[Don'\''t ASCII-armor output]' \
'--debug[Emit verbose output for debugging]' \
'-h[Print help]' \
'--help[Print help]' \
'*::keys -- Keys for signing:' \
&& 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
;;
(list-profiles)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(generate-key)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(change-key-password)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(revoke-key)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(extract-cert)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(update-key)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(merge-certs)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(certify-userid)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(validate-userid)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(sign)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(encrypt)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(decrypt)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(armor)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(dearmor)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(inline-detach)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(inline-verify)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(inline-sign)
_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' \
'list-profiles:Emits a list of profiles supported by the identified subcommand' \
'generate-key:Generates a Secret Key' \
'change-key-password:Updates a key'\''s password' \
'revoke-key:Creates a Revocation Certificate' \
'extract-cert:Extracts a Certificate from a Secret Key' \
'update-key:Keep a Secret Key Up-To-Date' \
'merge-certs:Merge OpenPGP Certificates' \
'certify-userid:Certify OpenPGP Certificate User IDs' \
'validate-userid:Validate a User ID in an OpenPGP Certificate' \
'sign:Creates Detached Signatures' \
'verify:Verifies Detached Signatures' \
'encrypt:Encrypts a Message' \
'decrypt:Decrypts a Message' \
'armor:Converts binary OpenPGP data to ASCII' \
'dearmor:Converts ASCII OpenPGP data to binary' \
'inline-detach:Splits Signatures from an Inline-Signed Message' \
'inline-verify:Verifies Inline-Signed Messages' \
'inline-sign:Creates Inline-Signed Messages' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sqopv commands' commands "$@"
}
(( $+functions[_sqopv__armor_commands] )) ||
_sqopv__armor_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv armor commands' commands "$@"
}
(( $+functions[_sqopv__help__armor_commands] )) ||
_sqopv__help__armor_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help armor commands' commands "$@"
}
(( $+functions[_sqopv__certify-userid_commands] )) ||
_sqopv__certify-userid_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv certify-userid commands' commands "$@"
}
(( $+functions[_sqopv__help__certify-userid_commands] )) ||
_sqopv__help__certify-userid_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help certify-userid commands' commands "$@"
}
(( $+functions[_sqopv__change-key-password_commands] )) ||
_sqopv__change-key-password_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv change-key-password commands' commands "$@"
}
(( $+functions[_sqopv__help__change-key-password_commands] )) ||
_sqopv__help__change-key-password_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help change-key-password commands' commands "$@"
}
(( $+functions[_sqopv__dearmor_commands] )) ||
_sqopv__dearmor_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv dearmor commands' commands "$@"
}
(( $+functions[_sqopv__help__dearmor_commands] )) ||
_sqopv__help__dearmor_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help dearmor commands' commands "$@"
}
(( $+functions[_sqopv__decrypt_commands] )) ||
_sqopv__decrypt_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv decrypt commands' commands "$@"
}
(( $+functions[_sqopv__help__decrypt_commands] )) ||
_sqopv__help__decrypt_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help decrypt commands' commands "$@"
}
(( $+functions[_sqopv__encrypt_commands] )) ||
_sqopv__encrypt_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv encrypt commands' commands "$@"
}
(( $+functions[_sqopv__help__encrypt_commands] )) ||
_sqopv__help__encrypt_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help encrypt commands' commands "$@"
}
(( $+functions[_sqopv__extract-cert_commands] )) ||
_sqopv__extract-cert_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv extract-cert commands' commands "$@"
}
(( $+functions[_sqopv__help__extract-cert_commands] )) ||
_sqopv__help__extract-cert_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help extract-cert commands' commands "$@"
}
(( $+functions[_sqopv__generate-key_commands] )) ||
_sqopv__generate-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv generate-key commands' commands "$@"
}
(( $+functions[_sqopv__help__generate-key_commands] )) ||
_sqopv__help__generate-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help generate-key commands' commands "$@"
}
(( $+functions[_sqopv__help_commands] )) ||
_sqopv__help_commands() {
    local commands; commands=(
'version:Prints version information' \
'list-profiles:Emits a list of profiles supported by the identified subcommand' \
'generate-key:Generates a Secret Key' \
'change-key-password:Updates a key'\''s password' \
'revoke-key:Creates a Revocation Certificate' \
'extract-cert:Extracts a Certificate from a Secret Key' \
'update-key:Keep a Secret Key Up-To-Date' \
'merge-certs:Merge OpenPGP Certificates' \
'certify-userid:Certify OpenPGP Certificate User IDs' \
'validate-userid:Validate a User ID in an OpenPGP Certificate' \
'sign:Creates Detached Signatures' \
'verify:Verifies Detached Signatures' \
'encrypt:Encrypts a Message' \
'decrypt:Decrypts a Message' \
'armor:Converts binary OpenPGP data to ASCII' \
'dearmor:Converts ASCII OpenPGP data to binary' \
'inline-detach:Splits Signatures from an Inline-Signed Message' \
'inline-verify:Verifies Inline-Signed Messages' \
'inline-sign:Creates 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-detach_commands] )) ||
_sqopv__help__inline-detach_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help inline-detach commands' commands "$@"
}
(( $+functions[_sqopv__inline-detach_commands] )) ||
_sqopv__inline-detach_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv inline-detach commands' commands "$@"
}
(( $+functions[_sqopv__help__inline-sign_commands] )) ||
_sqopv__help__inline-sign_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help inline-sign commands' commands "$@"
}
(( $+functions[_sqopv__inline-sign_commands] )) ||
_sqopv__inline-sign_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv inline-sign 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__list-profiles_commands] )) ||
_sqopv__help__list-profiles_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help list-profiles commands' commands "$@"
}
(( $+functions[_sqopv__list-profiles_commands] )) ||
_sqopv__list-profiles_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv list-profiles commands' commands "$@"
}
(( $+functions[_sqopv__help__merge-certs_commands] )) ||
_sqopv__help__merge-certs_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help merge-certs commands' commands "$@"
}
(( $+functions[_sqopv__merge-certs_commands] )) ||
_sqopv__merge-certs_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv merge-certs commands' commands "$@"
}
(( $+functions[_sqopv__help__revoke-key_commands] )) ||
_sqopv__help__revoke-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help revoke-key commands' commands "$@"
}
(( $+functions[_sqopv__revoke-key_commands] )) ||
_sqopv__revoke-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv revoke-key commands' commands "$@"
}
(( $+functions[_sqopv__help__sign_commands] )) ||
_sqopv__help__sign_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help sign commands' commands "$@"
}
(( $+functions[_sqopv__sign_commands] )) ||
_sqopv__sign_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv sign commands' commands "$@"
}
(( $+functions[_sqopv__help__update-key_commands] )) ||
_sqopv__help__update-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help update-key commands' commands "$@"
}
(( $+functions[_sqopv__update-key_commands] )) ||
_sqopv__update-key_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv update-key commands' commands "$@"
}
(( $+functions[_sqopv__help__validate-userid_commands] )) ||
_sqopv__help__validate-userid_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv help validate-userid commands' commands "$@"
}
(( $+functions[_sqopv__validate-userid_commands] )) ||
_sqopv__validate-userid_commands() {
    local commands; commands=()
    _describe -t commands 'sqopv validate-userid 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
