#compdef sqop

autoload -U is-at-least

_sqop() {
    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[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
":: :_sqop_commands" \
"*::: :->sop" \
&& ret=0
    case $state in
    (sop)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sqop-command-$line[1]:"
        case $line[1] in
            (version)
_arguments "${_arguments_options[@]}" \
'(--extended)--backend[Returns name and version of the primary underlying OpenPGP toolkit]' \
'(--backend)--extended[Returns multiple lines of name and version information]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(generate-key)
_arguments "${_arguments_options[@]}" \
'--no-armor[Don'\''t ASCII-armor output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::userids -- UserIDs for the generated key:_files' \
&& ret=0
;;
(extract-cert)
_arguments "${_arguments_options[@]}" \
'--no-armor[Don'\''t ASCII-armor output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(sign)
_arguments "${_arguments_options[@]}" \
'--as=[Sign binary data or UTF-8 text]' \
'--micalg-out=[Emit the digest algorithm used to the specified file]' \
'--no-armor[Don'\''t ASCII-armor output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::keys -- Keys for signing:_files' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" \
'--not-before=[Consider signatures before this date invalid]' \
'--not-after=[Consider signatures after this date invalid]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':signatures -- Signatures to verify:_files' \
'::certs -- Certs for verification:_files' \
&& ret=0
;;
(encrypt)
_arguments "${_arguments_options[@]}" \
'--as=[Encrypt binary data, UTF-8 text, or MIME data]' \
'*--with-password=[Encrypt with passwords]' \
'*--sign-with=[Keys for signing]' \
'--no-armor[Don'\''t ASCII-armor output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::certs -- Encrypt for these certs:_files' \
&& ret=0
;;
(decrypt)
_arguments "${_arguments_options[@]}" \
'--session-key-out=[Write the session key here]' \
'*--with-session-key=[Try to decrypt with this session key]' \
'*--with-password=[Try to decrypt with this password]' \
'--verify-out=[Write verification result here]' \
'*--verify-with=[Certs for verification]' \
'--verify-not-before=[Consider signatures before this date invalid]' \
'--verify-not-after=[Consider signatures after this date invalid]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::keys -- Try to decrypt with these keys:_files' \
&& ret=0
;;
(armor)
_arguments "${_arguments_options[@]}" \
'--label=[Indicates the kind of data]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(dearmor)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_sqop_commands] )) ||
_sqop_commands() {
    local commands; commands=(
        "version:Prints version information" \
"generate-key:Generates a Secret Key" \
"extract-cert:Extracts a Certificate from a Secret Key" \
"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" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'sqop commands' commands "$@"
}
(( $+functions[_sqop__armor_commands] )) ||
_sqop__armor_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop armor commands' commands "$@"
}
(( $+functions[_sqop__dearmor_commands] )) ||
_sqop__dearmor_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop dearmor commands' commands "$@"
}
(( $+functions[_sqop__decrypt_commands] )) ||
_sqop__decrypt_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop decrypt commands' commands "$@"
}
(( $+functions[_sqop__encrypt_commands] )) ||
_sqop__encrypt_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop encrypt commands' commands "$@"
}
(( $+functions[_sqop__extract-cert_commands] )) ||
_sqop__extract-cert_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop extract-cert commands' commands "$@"
}
(( $+functions[_sqop__generate-key_commands] )) ||
_sqop__generate-key_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop generate-key commands' commands "$@"
}
(( $+functions[_sqop__help_commands] )) ||
_sqop__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop help commands' commands "$@"
}
(( $+functions[_sqop__sign_commands] )) ||
_sqop__sign_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop sign commands' commands "$@"
}
(( $+functions[_sqop__verify_commands] )) ||
_sqop__verify_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop verify commands' commands "$@"
}
(( $+functions[_sqop__version_commands] )) ||
_sqop__version_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'sqop version commands' commands "$@"
}

_sqop "$@"