#compdef pixi-unpack

autoload -U is-at-least

_pixi-unpack() {
    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[@]}" : \
'-o+[Where to unpack the environment. The environment will be unpacked into a subdirectory of this path (default \`env\`, change with \`--env-name\`). The activation script will be written to the root of this path]:OUTPUT_DIRECTORY:_files' \
'--output-directory=[Where to unpack the environment. The environment will be unpacked into a subdirectory of this path (default \`env\`, change with \`--env-name\`). The activation script will be written to the root of this path]:OUTPUT_DIRECTORY:_files' \
'-e+[Name of the environment]:ENV_NAME:_default' \
'--env-name=[Name of the environment]:ENV_NAME:_default' \
'-s+[Sets the shell, options\: \[\`bash\`, \`zsh\`, \`xonsh\`, \`cmd\`, \`powershell\`, \`fish\`, \`nushell\`\]]:SHELL:_default' \
'--shell=[Sets the shell, options\: \[\`bash\`, \`zsh\`, \`xonsh\`, \`cmd\`, \`powershell\`, \`fish\`, \`nushell\`\]]:SHELL:_default' \
'*-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]' \
'-V[Print version]' \
'--version[Print version]' \
'::pack_file -- Path to the pack file:_files' \
":: :_pixi-unpack_commands" \
"*::: :->pixi-unpack" \
&& ret=0
    case $state in
    (pixi-unpack)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pixi-unpack-command-$line[2]:"
        case $line[2] in
            (completion)
_arguments "${_arguments_options[@]}" : \
'-s+[The shell to generate the completion script for]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[The shell to generate the completion script for]:SHELL:(bash elvish fish powershell zsh)' \
'*-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[@]}" : \
":: :_pixi-unpack__help_commands" \
"*::: :->help" \
&& ret=0

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

(( $+functions[_pixi-unpack_commands] )) ||
_pixi-unpack_commands() {
    local commands; commands=(
'completion:Generate shell completion script' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pixi-unpack commands' commands "$@"
}
(( $+functions[_pixi-unpack__completion_commands] )) ||
_pixi-unpack__completion_commands() {
    local commands; commands=()
    _describe -t commands 'pixi-unpack completion commands' commands "$@"
}
(( $+functions[_pixi-unpack__help_commands] )) ||
_pixi-unpack__help_commands() {
    local commands; commands=(
'completion:Generate shell completion script' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pixi-unpack help commands' commands "$@"
}
(( $+functions[_pixi-unpack__help__completion_commands] )) ||
_pixi-unpack__help__completion_commands() {
    local commands; commands=()
    _describe -t commands 'pixi-unpack help completion commands' commands "$@"
}
(( $+functions[_pixi-unpack__help__help_commands] )) ||
_pixi-unpack__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'pixi-unpack help help commands' commands "$@"
}

if [ "$funcstack[1]" = "_pixi-unpack" ]; then
    _pixi-unpack "$@"
else
    compdef _pixi-unpack pixi-unpack
fi
