#compdef sshd-openpgp-auth

autoload -U is-at-least

_sshd-openpgp-auth() {
    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[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_sshd-openpgp-auth_commands" \
"*::: :->sshd-openpgp-auth" \
&& ret=0
    case $state in
    (sshd-openpgp-auth)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
'-f+[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'--fingerprint=[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-S+[A custom directory in which to look for SSH public keys (defaults to "/etc/ssh/")]:DIR:_files' \
'--ssh-dir=[A custom directory in which to look for SSH public keys (defaults to "/etc/ssh/")]:DIR:_files' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'(-S --ssh-dir)-k[Read the SSH public keys in known_hosts format from stdin instead of from a directory]' \
'(-S --ssh-dir)--known-hosts[Read the SSH public keys in known_hosts format from stdin instead of from a directory]' \
'-s[Output the OpenPGP certificate to stdout instead of a file]' \
'--stdout[Output the OpenPGP certificate to stdout instead of a file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-O+[A custom output directory (defaults to "wkd")]:DIR:_files' \
'--output-dir=[A custom output directory (defaults to "wkd")]:DIR:_files' \
'-w+[A custom WKD type to export to (defaults to "advanced")]:WKD_TYPE: ' \
'--wkd-type=[A custom WKD type to export to (defaults to "advanced")]:WKD_TYPE: ' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':hostname -- The hostname, as fully qualified domain name (FQDN), for which to export:' \
&& ret=0
;;
(extend)
_arguments "${_arguments_options[@]}" \
'-e+[The expiry period in days from reference time (defaults to 365)]:EXPIRY: ' \
'--expiry=[The expiry period in days from reference time (defaults to 365)]:EXPIRY: ' \
'-f+[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'--fingerprint=[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-T+[A custom threshold in days from reference time, after which expiry period is extended (defaults to 250)]:THRESHOLD: ' \
'--threshold=[A custom threshold in days from reference time, after which expiry period is extended (defaults to 250)]:THRESHOLD: ' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-s[Output the OpenPGP certificate to stdout instead of a file]' \
'--stdout[Output the OpenPGP certificate to stdout instead of a file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" \
'-e+[The expiry period in days from reference time (defaults to 365)]:EXPIRY: ' \
'--expiry=[The expiry period in days from reference time (defaults to 365)]:EXPIRY: ' \
'(-s --stdout)-o+[A custom directory into which the OpenPGP certificate is written (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'(-s --stdout)--openpgp-dir=[A custom directory into which the OpenPGP certificate is written (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-s[Output the OpenPGP certificate to stdout instead of a file]' \
'--stdout[Output the OpenPGP certificate to stdout instead of a file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':host -- The hostname, as fully qualified domain name (FQDN), for which a certificate is created:' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
'-f+[A hostname, as fully qualified domain name (FQDN), by which to filter]:HOSTNAME: ' \
'--filter=[A hostname, as fully qualified domain name (FQDN), by which to filter]:HOSTNAME: ' \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(revoke)
_arguments "${_arguments_options[@]}" \
'-f+[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'--fingerprint=[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'-m+[An optional message for the revocation]:MESSAGE: ' \
'--message=[An optional message for the revocation]:MESSAGE: ' \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-r+[A custom revocation reason (defaults to "superseded")]:REASON: ' \
'--reason=[A custom revocation reason (defaults to "superseded")]:REASON: ' \
'(-a --all)*-S+[An OpenPGP fingerprint to identify a specific subkey]:SUBKEY_FINGERPRINT: ' \
'(-a --all)*--subkey-fingerprint=[An OpenPGP fingerprint to identify a specific subkey]:SUBKEY_FINGERPRINT: ' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-a[Revoke all subkeys of the chosen OpenPGP certificate]' \
'--all[Revoke all subkeys of the chosen OpenPGP certificate]' \
'-s[Output the OpenPGP certificate to stdout instead of a file]' \
'--stdout[Output the OpenPGP certificate to stdout instead of a file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(proof)
_arguments "${_arguments_options[@]}" \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_sshd-openpgp-auth__proof_commands" \
"*::: :->proof" \
&& ret=0

    case $state in
    (proof)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-proof-command-$line[1]:"
        case $line[1] in
            (dns)
_arguments "${_arguments_options[@]}" \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_sshd-openpgp-auth__proof__dns_commands" \
"*::: :->dns" \
&& ret=0

    case $state in
    (dns)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-proof-dns-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
'-o+[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'--openpgp-dir=[A custom directory in which to look for OpenPGP certificates (defaults to "/var/lib/sshd-openpgp-auth/")]:DIR:_files' \
'-f+[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'--fingerprint=[An OpenPGP fingerprint to identify a specific certificate]:FINGERPRINT: ' \
'-t+[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'--time=[A custom reference time formatted as an RFC3339 string (defaults to now)]:TIME: ' \
'-s[Output the OpenPGP certificate to stdout instead of a file]' \
'--stdout[Output the OpenPGP certificate to stdout instead of a file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__proof__dns__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-proof-dns-help-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__proof__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-proof-help-command-$line[1]:"
        case $line[1] in
            (dns)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__proof__help__dns_commands" \
"*::: :->dns" \
&& ret=0

    case $state in
    (dns)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-proof-help-dns-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-help-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(export)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(extend)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(revoke)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(proof)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__help__proof_commands" \
"*::: :->proof" \
&& ret=0

    case $state in
    (proof)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-help-proof-command-$line[1]:"
        case $line[1] in
            (dns)
_arguments "${_arguments_options[@]}" \
":: :_sshd-openpgp-auth__help__proof__dns_commands" \
"*::: :->dns" \
&& ret=0

    case $state in
    (dns)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:sshd-openpgp-auth-help-proof-dns-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_sshd-openpgp-auth_commands] )) ||
_sshd-openpgp-auth_commands() {
    local commands; commands=(
'add:Add public SSH host keys as authentication subkeys to an OpenPGP certificate' \
'export:Export OpenPGP certificates to Web Key Directory (WKD)' \
'extend:Extend the expiration period of an OpenPGP certificate' \
'init:Initialize a new OpenPGP certificate, that serves as trust anchor for public SSH host keys' \
'list:List local OpenPGP certificates that serve as trust anchor' \
'revoke:Revoke subkeys of an OpenPGP certificate' \
'proof:Manages Keyoxide proofs' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__add_commands] )) ||
_sshd-openpgp-auth__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__add_commands] )) ||
_sshd-openpgp-auth__help__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__proof__dns__add_commands] )) ||
_sshd-openpgp-auth__help__proof__dns__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help proof dns add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__dns__add_commands] )) ||
_sshd-openpgp-auth__proof__dns__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth proof dns add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__dns__help__add_commands] )) ||
_sshd-openpgp-auth__proof__dns__help__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth proof dns help add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__help__dns__add_commands] )) ||
_sshd-openpgp-auth__proof__help__dns__add_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth proof help dns add commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__proof__dns_commands] )) ||
_sshd-openpgp-auth__help__proof__dns_commands() {
    local commands; commands=(
'add:Add DNS proof to an OpenPGP certificate' \
    )
    _describe -t commands 'sshd-openpgp-auth help proof dns commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__dns_commands] )) ||
_sshd-openpgp-auth__proof__dns_commands() {
    local commands; commands=(
'add:Add DNS proof to an OpenPGP certificate' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth proof dns commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__help__dns_commands] )) ||
_sshd-openpgp-auth__proof__help__dns_commands() {
    local commands; commands=(
'add:Add DNS proof to an OpenPGP certificate' \
    )
    _describe -t commands 'sshd-openpgp-auth proof help dns commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__export_commands] )) ||
_sshd-openpgp-auth__export_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth export commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__export_commands] )) ||
_sshd-openpgp-auth__help__export_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help export commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__extend_commands] )) ||
_sshd-openpgp-auth__extend_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth extend commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__extend_commands] )) ||
_sshd-openpgp-auth__help__extend_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help extend commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help_commands] )) ||
_sshd-openpgp-auth__help_commands() {
    local commands; commands=(
'add:Add public SSH host keys as authentication subkeys to an OpenPGP certificate' \
'export:Export OpenPGP certificates to Web Key Directory (WKD)' \
'extend:Extend the expiration period of an OpenPGP certificate' \
'init:Initialize a new OpenPGP certificate, that serves as trust anchor for public SSH host keys' \
'list:List local OpenPGP certificates that serve as trust anchor' \
'revoke:Revoke subkeys of an OpenPGP certificate' \
'proof:Manages Keyoxide proofs' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__help_commands] )) ||
_sshd-openpgp-auth__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__dns__help_commands] )) ||
_sshd-openpgp-auth__proof__dns__help_commands() {
    local commands; commands=(
'add:Add DNS proof to an OpenPGP certificate' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth proof dns help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__dns__help__help_commands] )) ||
_sshd-openpgp-auth__proof__dns__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth proof dns help help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__help_commands] )) ||
_sshd-openpgp-auth__proof__help_commands() {
    local commands; commands=(
'dns:Manages DNS proofs' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth proof help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof__help__help_commands] )) ||
_sshd-openpgp-auth__proof__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth proof help help commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__init_commands] )) ||
_sshd-openpgp-auth__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help init commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__init_commands] )) ||
_sshd-openpgp-auth__init_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth init commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__list_commands] )) ||
_sshd-openpgp-auth__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help list commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__list_commands] )) ||
_sshd-openpgp-auth__list_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth list commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__proof_commands] )) ||
_sshd-openpgp-auth__help__proof_commands() {
    local commands; commands=(
'dns:Manages DNS proofs' \
    )
    _describe -t commands 'sshd-openpgp-auth help proof commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__proof_commands] )) ||
_sshd-openpgp-auth__proof_commands() {
    local commands; commands=(
'dns:Manages DNS proofs' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'sshd-openpgp-auth proof commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__help__revoke_commands] )) ||
_sshd-openpgp-auth__help__revoke_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth help revoke commands' commands "$@"
}
(( $+functions[_sshd-openpgp-auth__revoke_commands] )) ||
_sshd-openpgp-auth__revoke_commands() {
    local commands; commands=()
    _describe -t commands 'sshd-openpgp-auth revoke commands' commands "$@"
}

if [ "$funcstack[1]" = "_sshd-openpgp-auth" ]; then
    _sshd-openpgp-auth "$@"
else
    compdef _sshd-openpgp-auth sshd-openpgp-auth
fi
