#compdef eruption-hwutil

autoload -U is-at-least

_eruption-hwutil() {
    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+[Sets the configuration file to use]:CONFIG: ' \
'--config=[Sets the configuration file to use]:CONFIG: ' \
'*-v[Verbose mode (-v, -vv, -vvv, etc.)]' \
'*--verbose[Verbose mode (-v, -vv, -vvv, etc.)]' \
'-r[Repeat output until ctrl+c is pressed]' \
'--repeat[Repeat output until ctrl+c is pressed]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_eruption-hwutil_commands" \
"*::: :->eruption-hwutil" \
&& ret=0
    case $state in
    (eruption-hwutil)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eruption-hwutil-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':device:' \
&& ret=0
;;
(blackout)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':device:' \
&& ret=0
;;
(firmware)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
":: :_eruption-hwutil__firmware_commands" \
"*::: :->firmware" \
&& ret=0

    case $state in
    (firmware)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eruption-hwutil-firmware-command-$line[1]:"
        case $line[1] in
            (info)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':device:' \
&& ret=0
;;
(flash)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':device:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_eruption-hwutil__firmware__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eruption-hwutil-firmware-help-command-$line[1]:"
        case $line[1] in
            (info)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(flash)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_eruption-hwutil__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eruption-hwutil-help-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(blackout)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(firmware)
_arguments "${_arguments_options[@]}" \
":: :_eruption-hwutil__help__firmware_commands" \
"*::: :->firmware" \
&& ret=0

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

(( $+functions[_eruption-hwutil_commands] )) ||
_eruption-hwutil_commands() {
    local commands; commands=(
'list:List available devices, use this first to find out the index of the device to address' \
'status:Query device specific status like e.g.\: Signal Strength/Battery Level' \
'blackout:Turn off all LEDs, but otherwise leave the device completely usable' \
'firmware:Firmware related subcommands (DANGEROUS, may brick the device)' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eruption-hwutil commands' commands "$@"
}
(( $+functions[_eruption-hwutil__blackout_commands] )) ||
_eruption-hwutil__blackout_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil blackout commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__blackout_commands] )) ||
_eruption-hwutil__help__blackout_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help blackout commands' commands "$@"
}
(( $+functions[_eruption-hwutil__completions_commands] )) ||
_eruption-hwutil__completions_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil completions commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__completions_commands] )) ||
_eruption-hwutil__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help completions commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware_commands] )) ||
_eruption-hwutil__firmware_commands() {
    local commands; commands=(
'info:Get some information about the currently installed firmware' \
'flash:Flash firmware to device (DANGEROUS, may brick the device)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eruption-hwutil firmware commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__firmware_commands] )) ||
_eruption-hwutil__help__firmware_commands() {
    local commands; commands=(
'info:Get some information about the currently installed firmware' \
'flash:Flash firmware to device (DANGEROUS, may brick the device)' \
    )
    _describe -t commands 'eruption-hwutil help firmware commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__flash_commands] )) ||
_eruption-hwutil__firmware__flash_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil firmware flash commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__help__flash_commands] )) ||
_eruption-hwutil__firmware__help__flash_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil firmware help flash commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__firmware__flash_commands] )) ||
_eruption-hwutil__help__firmware__flash_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help firmware flash commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__help_commands] )) ||
_eruption-hwutil__firmware__help_commands() {
    local commands; commands=(
'info:Get some information about the currently installed firmware' \
'flash:Flash firmware to device (DANGEROUS, may brick the device)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eruption-hwutil firmware help commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__help__help_commands] )) ||
_eruption-hwutil__firmware__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil firmware help help commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help_commands] )) ||
_eruption-hwutil__help_commands() {
    local commands; commands=(
'list:List available devices, use this first to find out the index of the device to address' \
'status:Query device specific status like e.g.\: Signal Strength/Battery Level' \
'blackout:Turn off all LEDs, but otherwise leave the device completely usable' \
'firmware:Firmware related subcommands (DANGEROUS, may brick the device)' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eruption-hwutil help commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__help_commands] )) ||
_eruption-hwutil__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help help commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__help__info_commands] )) ||
_eruption-hwutil__firmware__help__info_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil firmware help info commands' commands "$@"
}
(( $+functions[_eruption-hwutil__firmware__info_commands] )) ||
_eruption-hwutil__firmware__info_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil firmware info commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__firmware__info_commands] )) ||
_eruption-hwutil__help__firmware__info_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help firmware info commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__list_commands] )) ||
_eruption-hwutil__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help list commands' commands "$@"
}
(( $+functions[_eruption-hwutil__list_commands] )) ||
_eruption-hwutil__list_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil list commands' commands "$@"
}
(( $+functions[_eruption-hwutil__help__status_commands] )) ||
_eruption-hwutil__help__status_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil help status commands' commands "$@"
}
(( $+functions[_eruption-hwutil__status_commands] )) ||
_eruption-hwutil__status_commands() {
    local commands; commands=()
    _describe -t commands 'eruption-hwutil status commands' commands "$@"
}

if [ "$funcstack[1]" = "_eruption-hwutil" ]; then
    _eruption-hwutil "$@"
else
    compdef _eruption-hwutil eruption-hwutil
fi
