#compdef cargo-sync-rdme

autoload -U is-at-least

_cargo-sync-rdme() {
    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+[Package to sync README]:SPEC: ' \
'*--package=[Package to sync README]:SPEC: ' \
'*-F+[Space or comma separated list of features to activate]:FEATURES: ' \
'*--features=[Space or comma separated list of features to activate]:FEATURES: ' \
'--toolchain=[Toolchain name to run `cargo rustdoc` with]:TOOLCHAIN: ' \
'*-v[More output per occurrence]' \
'*--verbose[More output per occurrence]' \
'(-v --verbose)*-q[Less output per occurrence]' \
'(-v --verbose)*--quiet[Less output per occurrence]' \
'--workspace[Sync READMEs for all packages in the workspace]' \
'--all-features[Activate all available features]' \
'--no-default-features[Do not activate the `default` feature]' \
'--check[Check if READMEs are synced]' \
'--allow-no-vcs[Sync README even if a VCS was not detected]' \
'--allow-dirty[Sync README even if the target file is dirty]' \
'--allow-staged[Sync README even if the target file has staged changes]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

(( $+functions[_cargo-sync-rdme_commands] )) ||
_cargo-sync-rdme_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-sync-rdme commands' commands "$@"
}

_cargo-sync-rdme "$@"
