#compdef wkd-exporter

autoload -U is-at-least

_wkd-exporter() {
    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[@]}" : \
'*--domain=[Only export the following domain (may be given multiple times)]:DOMAIN:_default' \
'--direct=[Select direct WKD variant with a filter for this single domain]:DIRECT:_default' \
'--append[Append incoming certificates to the ones already existing in \`.well-known\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':well_known -- Well known directory that will be the output of the exporting process:_files' \
&& ret=0
}

(( $+functions[_wkd-exporter_commands] )) ||
_wkd-exporter_commands() {
    local commands; commands=()
    _describe -t commands 'wkd-exporter commands' commands "$@"
}

if [ "$funcstack[1]" = "_wkd-exporter" ]; then
    _wkd-exporter "$@"
else
    compdef _wkd-exporter wkd-exporter
fi
