#compdef rust-rpm-prov

autoload -U is-at-least

_rust-rpm-prov() {
    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 information]' \
'--help[Print help information]' \
":: :_rust-rpm-prov_commands" \
"*::: :->rust-rpm-prov" \
&& ret=0
    case $state in
    (rust-rpm-prov)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rust-rpm-prov-command-$line[1]:"
        case $line[1] in
            (rpm-provides)
_arguments "${_arguments_options[@]}" \
'-h[Print help information]' \
'--help[Print help information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_rust-rpm-prov_commands] )) ||
_rust-rpm-prov_commands() {
    local commands; commands=(
'rpm-provides:Generate a list of provides based on the built packages Cargo.lock. This is part of the internals of an rpm build and shouldn'\''t be called directly. The "glue" is from /usr/lib/rpm/fileattrs/rust.attr which actually drives this command' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rust-rpm-prov commands' commands "$@"
}
(( $+functions[_rust-rpm-prov__help_commands] )) ||
_rust-rpm-prov__help_commands() {
    local commands; commands=()
    _describe -t commands 'rust-rpm-prov help commands' commands "$@"
}
(( $+functions[_rust-rpm-prov__rpm-provides_commands] )) ||
_rust-rpm-prov__rpm-provides_commands() {
    local commands; commands=()
    _describe -t commands 'rust-rpm-prov rpm-provides commands' commands "$@"
}

_rust-rpm-prov "$@"
