#compdef cargo-thanku

autoload -U is-at-least

_cargo-thanku() {
    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[@]}" : \
'-l+[更改语言]: :(zh en ja ko es fr de it)' \
'--language=[更改语言]: :(zh en ja ko es fr de it)' \
'-i+[输入 Cargo.toml 文件或项目目录]: :_files' \
'--input=[输入 Cargo.toml 文件或项目目录]: :_files' \
'-o+[输出文件路径]: :_files' \
'--output=[输出文件路径]: :_files' \
'-f+[输出内容格式]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'--format=[输出内容格式]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'-s+[链接来源 (link-empty 意味着链接为占位符链接，other 意味着未知来源，无链接作用)]: :(github crates-io link-empty other)' \
'--source=[链接来源 (link-empty 意味着链接为占位符链接，other 意味着未知来源，无链接作用)]: :(github crates-io link-empty other)' \
'-t+[GitHub 认证令牌 (需要 GitHub 操作时必填)]: :_default' \
'--token=[GitHub 认证令牌 (需要 GitHub 操作时必填)]: :_default' \
'-j+[并发请求数]: :_default' \
'--concurrent=[并发请求数]: :_default' \
'-r+[重试次数]: :_default' \
'--retries=[重试次数]: :_default' \
'-v[详细输出，会输出更多信息，适用于调试]' \
'--verbose[详细输出，会输出更多信息，适用于调试]' \
'--no-relative-libs[过滤掉相对路径导入的库]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_cargo-thanku_commands" \
"*::: :->cargo-thanku" \
&& ret=0
    case $state in
    (cargo-thanku)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cargo-thanku-command-$line[1]:"
        case $line[1] in
            (thanku)
_arguments "${_arguments_options[@]}" : \
'-i+[输入 Cargo.toml 文件或项目目录]: :_files' \
'--input=[输入 Cargo.toml 文件或项目目录]: :_files' \
'-o+[输出文件路径]: :_files' \
'--output=[输出文件路径]: :_files' \
'-f+[输出内容格式]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'--format=[输出内容格式]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'-s+[链接来源 (link-empty 意味着链接为占位符链接，other 意味着未知来源，无链接作用)]: :(github crates-io link-empty other)' \
'--source=[链接来源 (link-empty 意味着链接为占位符链接，other 意味着未知来源，无链接作用)]: :(github crates-io link-empty other)' \
'-t+[GitHub 认证令牌 (需要 GitHub 操作时必填)]: :_default' \
'--token=[GitHub 认证令牌 (需要 GitHub 操作时必填)]: :_default' \
'-j+[并发请求数]: :_default' \
'--concurrent=[并发请求数]: :_default' \
'-r+[重试次数]: :_default' \
'--retries=[重试次数]: :_default' \
'-l+[更改语言]: :(zh en ja ko es fr de it)' \
'--language=[更改语言]: :(zh en ja ko es fr de it)' \
'--no-relative-libs[过滤掉相对路径导入的库]' \
'-v[详细输出，会输出更多信息，适用于调试]' \
'--verbose[详细输出，会输出更多信息，适用于调试]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
'-i+[输入文件路径]: :_files' \
'--input=[输入文件路径]: :_files' \
'-o+[输出文件们的格式，使用逗号分隔]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'--outputs=[输出文件们的格式，使用逗号分隔]: :(mt ml csv json yaml toml yml markdown-list markdown-table)' \
'-l+[更改语言]: :(zh en ja ko es fr de it)' \
'--language=[更改语言]: :(zh en ja ko es fr de it)' \
'-v[详细输出，会输出更多信息，适用于调试]' \
'--verbose[详细输出，会输出更多信息，适用于调试]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-l+[更改语言]: :(zh en ja ko es fr de it)' \
'--language=[更改语言]: :(zh en ja ko es fr de it)' \
'-v[详细输出，会输出更多信息，适用于调试]' \
'--verbose[详细输出，会输出更多信息，适用于调试]' \
'-h[Print help]' \
'--help[Print help]' \
':shell -- 目标 shell:(bash fish zsh powershell elvish)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cargo-thanku__help_commands" \
"*::: :->help" \
&& ret=0

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

(( $+functions[_cargo-thanku_commands] )) ||
_cargo-thanku_commands() {
    local commands; commands=(
'thanku:💖 在 Rust 项目根目录使用 \`cargo thanku\` 或 \`cargo-thanku\` 生成依赖项致谢列表。' \
'convert:转换格式，将输入文件转换为指定格式们' \
'completions:生成 shell 补全' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-thanku commands' commands "$@"
}
(( $+functions[_cargo-thanku__completions_commands] )) ||
_cargo-thanku__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku completions commands' commands "$@"
}
(( $+functions[_cargo-thanku__convert_commands] )) ||
_cargo-thanku__convert_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku convert commands' commands "$@"
}
(( $+functions[_cargo-thanku__help_commands] )) ||
_cargo-thanku__help_commands() {
    local commands; commands=(
'thanku:💖 在 Rust 项目根目录使用 \`cargo thanku\` 或 \`cargo-thanku\` 生成依赖项致谢列表。' \
'convert:转换格式，将输入文件转换为指定格式们' \
'completions:生成 shell 补全' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cargo-thanku help commands' commands "$@"
}
(( $+functions[_cargo-thanku__help__completions_commands] )) ||
_cargo-thanku__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku help completions commands' commands "$@"
}
(( $+functions[_cargo-thanku__help__convert_commands] )) ||
_cargo-thanku__help__convert_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku help convert commands' commands "$@"
}
(( $+functions[_cargo-thanku__help__help_commands] )) ||
_cargo-thanku__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku help help commands' commands "$@"
}
(( $+functions[_cargo-thanku__help__thanku_commands] )) ||
_cargo-thanku__help__thanku_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku help thanku commands' commands "$@"
}
(( $+functions[_cargo-thanku__thanku_commands] )) ||
_cargo-thanku__thanku_commands() {
    local commands; commands=()
    _describe -t commands 'cargo-thanku thanku commands' commands "$@"
}

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