#compdef sq-keyring-linter

autoload -U is-at-least

_sq-keyring-linter() {
    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[@]}" : \
'-t+[Sets the reference time to TIME]:TIME:_default' \
'--time=[Sets the reference time to TIME]:TIME:_default' \
'*-p+[A key'\''s password.  Normally this is not needed\: if stdin is connected to a tty, the linter will ask for a password when needed.]:PASSWORD:_default' \
'*--password=[A key'\''s password.  Normally this is not needed\: if stdin is connected to a tty, the linter will ask for a password when needed.]:PASSWORD:_default' \
'-q[Quiet; does not output any diagnostics]' \
'--quiet[Quiet; does not output any diagnostics]' \
'-f[Attempts to fix certificates, when possible]' \
'--fix[Attempts to fix certificates, when possible]' \
'-e[When fixing a certificate, the fixed certificate is exported without any secret key material.  Using this switch causes any secret key material to also be exported.]' \
'--export-secret-keys[When fixing a certificate, the fixed certificate is exported without any secret key material.  Using this switch causes any secret key material to also be exported.]' \
'-k[If set, outputs a list of fingerprints, one per line, of certificates that have issues.  This output is intended for use by scripts.]' \
'--list-keys[If set, outputs a list of fingerprints, one per line, of certificates that have issues.  This output is intended for use by scripts.]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::file -- A list of OpenPGP keyrings to process.  If none are specified,
a keyring is read from stdin.:_default' \
&& ret=0
}

(( $+functions[_sq-keyring-linter_commands] )) ||
_sq-keyring-linter_commands() {
    local commands; commands=()
    _describe -t commands 'sq-keyring-linter commands' commands "$@"
}

if [ "$funcstack[1]" = "_sq-keyring-linter" ]; then
    _sq-keyring-linter "$@"
else
    compdef _sq-keyring-linter sq-keyring-linter
fi
