#compdef cargo-public-api

autoload -U is-at-least

_cargo-public-api() {
    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[@]}" \
'--manifest-path=[Path to `Cargo.toml`]:PATH:_files' \
'-p+[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'--package=[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'*--omit=[Omit specified items]:OMIT:((blanket-impls\:"Omit items that belong to Blanket Implementations such as `impl<T> Any for T`, `impl<T> Borrow<T> for T`, and `impl<T, U> Into<U> for T where U: From<T>`"
auto-trait-impls\:"Omit items that belong to Auto Trait Implementations such as `impl Send for ...`, `impl Sync for ...`, and `impl Unpin for ...`"
auto-derived-impls\:"Omit items that belong to Auto Derived Implementations such as `Clone`, `Debug`, and `Eq`"))' \
'*-F+[Space or comma separated list of features to activate]:FEATURES: ' \
'*--features=[Space or comma separated list of features to activate]:FEATURES: ' \
'--target=[Build for the target triple]:TARGET: ' \
'--color=[When to color the output]' \
'--rustdoc-json=[List the public API based on the given rustdoc JSON file]:RUSTDOC_JSON_PATH: ' \
'--target-dir=[Where to put rustdoc JSON build artifacts]:PATH:_files' \
'--cap-lints=[Forwarded to rustdoc JSON build command]:CAP_LINTS: ' \
'*-s[Omit noisy items. Can be used more than once.]' \
'*--simplified[Omit noisy items. Can be used more than once.]' \
'--all-features[Activate all available features]' \
'--no-default-features[Do not activate the `default` feature]' \
'--verbose[Show detailed info about processing]' \
'--debug-sorting[Show the hidden "sorting prefix" that makes items nicely grouped]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_cargo-public-api_commands" \
"*::: :->cargo-public-api" \
&& ret=0
    case $state in
    (cargo-public-api)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cargo-public-api-command-$line[1]:"
        case $line[1] in
            (diff)
_arguments "${_arguments_options[@]}" \
'*--deny=[Exit with failure if the specified API diff is detected]:DENY:((all\:"All forms of API diffs are denied: additions, changes, deletions"
added\:"Deny added things in API diffs"
changed\:"Deny changed things in API diffs"
removed\:"Deny removed things in API diffs"))' \
'--manifest-path=[Path to `Cargo.toml`]:PATH:_files' \
'-p+[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'--package=[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'*--omit=[Omit specified items]:OMIT:((blanket-impls\:"Omit items that belong to Blanket Implementations such as `impl<T> Any for T`, `impl<T> Borrow<T> for T`, and `impl<T, U> Into<U> for T where U: From<T>`"
auto-trait-impls\:"Omit items that belong to Auto Trait Implementations such as `impl Send for ...`, `impl Sync for ...`, and `impl Unpin for ...`"
auto-derived-impls\:"Omit items that belong to Auto Derived Implementations such as `Clone`, `Debug`, and `Eq`"))' \
'*-F+[Space or comma separated list of features to activate]:FEATURES: ' \
'*--features=[Space or comma separated list of features to activate]:FEATURES: ' \
'--target=[Build for the target triple]:TARGET: ' \
'--color=[When to color the output]' \
'--rustdoc-json=[List the public API based on the given rustdoc JSON file]:RUSTDOC_JSON_PATH: ' \
'--target-dir=[Where to put rustdoc JSON build artifacts]:PATH:_files' \
'--cap-lints=[Forwarded to rustdoc JSON build command]:CAP_LINTS: ' \
'--force[Force the diff. For example, when diffing commits, enabling this option will discard working tree changes during git checkouts of other commits]' \
'*-s[Omit noisy items. Can be used more than once.]' \
'*--simplified[Omit noisy items. Can be used more than once.]' \
'--all-features[Activate all available features]' \
'--no-default-features[Do not activate the `default` feature]' \
'--verbose[Show detailed info about processing]' \
'--debug-sorting[Show the hidden "sorting prefix" that makes items nicely grouped]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::args -- What to diff.:' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" \
'--manifest-path=[Path to `Cargo.toml`]:PATH:_files' \
'-p+[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'--package=[Name of package in workspace to list or diff the public API for]:PACKAGE: ' \
'*--omit=[Omit specified items]:OMIT:((blanket-impls\:"Omit items that belong to Blanket Implementations such as `impl<T> Any for T`, `impl<T> Borrow<T> for T`, and `impl<T, U> Into<U> for T where U: From<T>`"
auto-trait-impls\:"Omit items that belong to Auto Trait Implementations such as `impl Send for ...`, `impl Sync for ...`, and `impl Unpin for ...`"
auto-derived-impls\:"Omit items that belong to Auto Derived Implementations such as `Clone`, `Debug`, and `Eq`"))' \
'*-F+[Space or comma separated list of features to activate]:FEATURES: ' \
'*--features=[Space or comma separated list of features to activate]:FEATURES: ' \
'--target=[Build for the target triple]:TARGET: ' \
'--color=[When to color the output]' \
'--rustdoc-json=[List the public API based on the given rustdoc JSON file]:RUSTDOC_JSON_PATH: ' \
'--target-dir=[Where to put rustdoc JSON build artifacts]:PATH:_files' \
'--cap-lints=[Forwarded to rustdoc JSON build command]:CAP_LINTS: ' \
'*-s[Omit noisy items. Can be used more than once.]' \
'*--simplified[Omit noisy items. Can be used more than once.]' \
'--all-features[Activate all available features]' \
'--no-default-features[Do not activate the `default` feature]' \
'--verbose[Show detailed info about processing]' \
'--debug-sorting[Show the hidden "sorting prefix" that makes items nicely grouped]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':shell:(bash elvish fig fish nushell powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_cargo-public-api__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cargo-public-api-help-command-$line[1]:"
        case $line[1] in
            (diff)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_cargo-public-api_commands] )) ||
_cargo-public-api_commands() {
    local commands; commands=(
'diff:Diff the public API against a published version of the crate, or between commits.' \
'completions:Generate completion scripts for many different shells.' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-public-api commands' commands "$@"
}
(( $+functions[_cargo-public-api__completions_commands] )) ||
_cargo-public-api__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-public-api completions commands' commands "$@"
}
(( $+functions[_cargo-public-api__help__completions_commands] )) ||
_cargo-public-api__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-public-api help completions commands' commands "$@"
}
(( $+functions[_cargo-public-api__diff_commands] )) ||
_cargo-public-api__diff_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-public-api diff commands' commands "$@"
}
(( $+functions[_cargo-public-api__help__diff_commands] )) ||
_cargo-public-api__help__diff_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-public-api help diff commands' commands "$@"
}
(( $+functions[_cargo-public-api__help_commands] )) ||
_cargo-public-api__help_commands() {
    local commands; commands=(
'diff:Diff the public API against a published version of the crate, or between commits.' \
'completions:Generate completion scripts for many different shells.' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-public-api help commands' commands "$@"
}
(( $+functions[_cargo-public-api__help__help_commands] )) ||
_cargo-public-api__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-public-api help help commands' commands "$@"
}

if [ "$funcstack[1]" = "_cargo-public-api" ]; then
    _cargo-public-api "$@"
else
    compdef _cargo-public-api cargo-public-api
fi
