#compdef cargo-spellcheck

autoload -U is-at-least

_cargo-spellcheck() {
    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[@]}" : \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'--checkers=[Execute the given subset of checkers]:CHECKERS:_default' \
'-j+[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'--jobs=[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'-m+[Return code of the application if spelling mistakes were found]:CODE:_default' \
'--code=[Return code of the application if spelling mistakes were found]:CODE:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-r[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'--recursive[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'-s[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'--skip-readme[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'-d[Also check developer comments besides documentation comments]' \
'--dev-comments[Also check developer comments besides documentation comments]' \
'-f[Alt for \`cargo spellcheck fix\` \[deprecated\]]' \
'--fix[Alt for \`cargo spellcheck fix\` \[deprecated\]]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::paths -- A list of files and directories to check. See `--recursive`:_files' \
":: :_cargo-spellcheck_commands" \
"*::: :->cargo-spellcheck" \
&& ret=0
    case $state in
    (cargo-spellcheck)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cargo-spellcheck-command-$line[2]:"
        case $line[2] in
            (check)
_arguments "${_arguments_options[@]}" : \
'--checkers=[Execute the given subset of checkers]:CHECKERS:_default' \
'-j+[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'--jobs=[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'-m+[Return code of the application if spelling mistakes were found]:CODE:_default' \
'--code=[Return code of the application if spelling mistakes were found]:CODE:_default' \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'-r[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'--recursive[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'-s[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'--skip-readme[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'-d[Also check developer comments besides documentation comments]' \
'--dev-comments[Also check developer comments besides documentation comments]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::paths -- A list of files and directories to check. See `--recursive`:_files' \
&& ret=0
;;
(fix)
_arguments "${_arguments_options[@]}" : \
'--checkers=[Execute the given subset of checkers]:CHECKERS:_default' \
'-j+[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'--jobs=[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'-m+[Return code of the application if spelling mistakes were found]:CODE:_default' \
'--code=[Return code of the application if spelling mistakes were found]:CODE:_default' \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'-r[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'--recursive[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'-s[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'--skip-readme[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'-d[Also check developer comments besides documentation comments]' \
'--dev-comments[Also check developer comments besides documentation comments]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::paths -- A list of files and directories to check. See `--recursive`:_files' \
&& ret=0
;;
(reflow)
_arguments "${_arguments_options[@]}" : \
'--checkers=[Execute the given subset of checkers]:CHECKERS:_default' \
'-j+[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'--jobs=[The number of worker threads to spawn for the actual processing text]:JOBS:_default' \
'-m+[Return code of the application if spelling mistakes were found]:CODE:_default' \
'--code=[Return code of the application if spelling mistakes were found]:CODE:_default' \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'-r[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'--recursive[Recurse based on the current directory, or all given argument paths, and also declared modules in rust files]' \
'-s[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'--skip-readme[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'-d[Also check developer comments besides documentation comments]' \
'--dev-comments[Also check developer comments besides documentation comments]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::paths -- A list of files and directories to check. See `--recursive`:_files' \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
'--filter=[Limit checkers to enable in the generated configuration]:FILTER:_default' \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'-u[Write to the default user configuration file path]' \
'--user[Write to the default user configuration file path]' \
'-o[Force overwrite an existing user config]' \
'--overwrite[Force overwrite an existing user config]' \
'-s[Write to \`stdout\`]' \
'--stdout[Write to \`stdout\`]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list-files)
_arguments "${_arguments_options[@]}" : \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'-r[Recurse down directories and module declaration derived paths]' \
'--recursive[Recurse down directories and module declaration derived paths]' \
'-s[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'--skip-readme[Do not check the referenced key \`readme=\` or default \`README.md\`]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'*::paths -- A list of files and directories to check. See `--recursive`:_files' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'--shell=[Provide the \`shell\` for which to generate the completion script]:SHELL:_default' \
'-c+[Provide a configuration]:CFG:_files' \
'--cfg=[Provide a configuration]:CFG:_files' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cargo-spellcheck__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cargo-spellcheck-help-command-$line[1]:"
        case $line[1] in
            (check)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fix)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reflow)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list-files)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_cargo-spellcheck_commands] )) ||
_cargo-spellcheck_commands() {
    local commands; commands=(
'check:Only show check errors, but do not request user input' \
'fix:Interactively choose from checker provided suggestions' \
'reflow:Reflow doc comments, so they adhere to a given maximum column width' \
'config:Print the config being in use, default config if none' \
'list-files:List all files in depth-first-sorted-order in which they would be checked' \
'completions:Print completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-spellcheck commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__check_commands] )) ||
_cargo-spellcheck__check_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck check commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__completions_commands] )) ||
_cargo-spellcheck__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck completions commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__config_commands] )) ||
_cargo-spellcheck__config_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck config commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__fix_commands] )) ||
_cargo-spellcheck__fix_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck fix commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help_commands] )) ||
_cargo-spellcheck__help_commands() {
    local commands; commands=(
'check:Only show check errors, but do not request user input' \
'fix:Interactively choose from checker provided suggestions' \
'reflow:Reflow doc comments, so they adhere to a given maximum column width' \
'config:Print the config being in use, default config if none' \
'list-files:List all files in depth-first-sorted-order in which they would be checked' \
'completions:Print completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-spellcheck help commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__check_commands] )) ||
_cargo-spellcheck__help__check_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help check commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__completions_commands] )) ||
_cargo-spellcheck__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help completions commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__config_commands] )) ||
_cargo-spellcheck__help__config_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help config commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__fix_commands] )) ||
_cargo-spellcheck__help__fix_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help fix commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__help_commands] )) ||
_cargo-spellcheck__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help help commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__list-files_commands] )) ||
_cargo-spellcheck__help__list-files_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help list-files commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__help__reflow_commands] )) ||
_cargo-spellcheck__help__reflow_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck help reflow commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__list-files_commands] )) ||
_cargo-spellcheck__list-files_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck list-files commands' commands "$@"
}
(( $+functions[_cargo-spellcheck__reflow_commands] )) ||
_cargo-spellcheck__reflow_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-spellcheck reflow commands' commands "$@"
}

if [ "$funcstack[1]" = "_cargo-spellcheck" ]; then
    _cargo-spellcheck "$@"
else
    compdef _cargo-spellcheck cargo-spellcheck
fi
[?25h