#compdef openscq30

autoload -U is-at-least

_openscq30() {
    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[@]}" : \
'--debug-errors[Displays additional information with errors for debugging purposes. Deprecated, use --verbose instead.]' \
'*-v[Enables logging with warn log level. Using this argument multiple times will decrease min log level, up to -vvvv.]' \
'*--verbose[Enables logging with warn log level. Using this argument multiple times will decrease min log level, up to -vvvv.]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_openscq30_commands" \
"*::: :->openscq30" \
&& ret=0
    case $state in
    (openscq30)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-command-$line[1]:"
        case $line[1] in
            (paired-devices)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_openscq30__subcmd__paired-devices_commands" \
"*::: :->paired-devices" \
&& ret=0

    case $state in
    (paired-devices)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-paired-devices-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'-a+[Device'\''s mac address]:MAC_ADDRESS:_default' \
'--mac-address=[Device'\''s mac address]:MAC_ADDRESS:_default' \
'-m+[Device model]:MODEL:_default' \
'--model=[Device model]:MODEL:_default' \
'--demo[Enable demo mode for the device]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-a+[Device'\''s mac address]:MAC_ADDRESS:_default' \
'--mac-address=[Device'\''s mac address]:MAC_ADDRESS:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'-j[Output as JSON]' \
'--json[Output as JSON]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_openscq30__subcmd__paired-devices__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-paired-devices-help-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(device)
_arguments "${_arguments_options[@]}" : \
'-a+[Device'\''s mac address]:MAC_ADDRESS:_default' \
'--mac-address=[Device'\''s mac address]:MAC_ADDRESS:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_openscq30__subcmd__device_commands" \
"*::: :->device" \
&& ret=0

    case $state in
    (device)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-device-command-$line[1]:"
        case $line[1] in
            (list-settings)
_arguments "${_arguments_options[@]}" : \
'--no-categories[Don'\''t display category headers]' \
'--no-extended-info[Don'\''t display setting information in addition to the setting id]' \
'-j[Output as JSON]' \
'--json[Output as JSON]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(setting)
_arguments "${_arguments_options[@]}" : \
'*-g+[Gets the value of a setting]:SETTING_ID:_default' \
'*--get=[Gets the value of a setting]:SETTING_ID:_default' \
'*-s+[Sets the value of a setting.]:SETTING_ID=VALUE:_default' \
'*--set=[Sets the value of a setting.]:SETTING_ID=VALUE:_default' \
'-j[Output as JSON]' \
'--json[Output as JSON]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_openscq30__subcmd__device__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-device-help-command-$line[1]:"
        case $line[1] in
            (list-settings)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(setting)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(list-models)
_arguments "${_arguments_options[@]}" : \
'-j[Output as JSON]' \
'--json[Output as JSON]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-s+[Target shell to generate completions for]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[Target shell to generate completions for]:SHELL:(bash elvish fish powershell zsh)' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_openscq30__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-help-command-$line[1]:"
        case $line[1] in
            (paired-devices)
_arguments "${_arguments_options[@]}" : \
":: :_openscq30__subcmd__help__subcmd__paired-devices_commands" \
"*::: :->paired-devices" \
&& ret=0

    case $state in
    (paired-devices)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-help-paired-devices-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(device)
_arguments "${_arguments_options[@]}" : \
":: :_openscq30__subcmd__help__subcmd__device_commands" \
"*::: :->device" \
&& ret=0

    case $state in
    (device)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:openscq30-help-device-command-$line[1]:"
        case $line[1] in
            (list-settings)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(setting)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(list-models)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_openscq30_commands] )) ||
_openscq30_commands() {
    local commands; commands=(
'paired-devices:Pair bluetooth devices with openscq30' \
'device:Device settings' \
'list-models:List all supported device models and their names' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__completions_commands] )) ||
_openscq30__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 completions commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device_commands] )) ||
_openscq30__subcmd__device_commands() {
    local commands; commands=(
'list-settings:List all currently available settings' \
'setting:get/set setting values' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 device commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__help_commands] )) ||
_openscq30__subcmd__device__subcmd__help_commands() {
    local commands; commands=(
'list-settings:List all currently available settings' \
'setting:get/set setting values' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 device help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__help__subcmd__help_commands] )) ||
_openscq30__subcmd__device__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 device help help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__help__subcmd__list-settings_commands] )) ||
_openscq30__subcmd__device__subcmd__help__subcmd__list-settings_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 device help list-settings commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__help__subcmd__setting_commands] )) ||
_openscq30__subcmd__device__subcmd__help__subcmd__setting_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 device help setting commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__list-settings_commands] )) ||
_openscq30__subcmd__device__subcmd__list-settings_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 device list-settings commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__device__subcmd__setting_commands] )) ||
_openscq30__subcmd__device__subcmd__setting_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 device setting commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help_commands] )) ||
_openscq30__subcmd__help_commands() {
    local commands; commands=(
'paired-devices:Pair bluetooth devices with openscq30' \
'device:Device settings' \
'list-models:List all supported device models and their names' \
'completions:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__completions_commands] )) ||
_openscq30__subcmd__help__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help completions commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__device_commands] )) ||
_openscq30__subcmd__help__subcmd__device_commands() {
    local commands; commands=(
'list-settings:List all currently available settings' \
'setting:get/set setting values' \
    )
    _describe -t commands 'openscq30 help device commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__device__subcmd__list-settings_commands] )) ||
_openscq30__subcmd__help__subcmd__device__subcmd__list-settings_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help device list-settings commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__device__subcmd__setting_commands] )) ||
_openscq30__subcmd__help__subcmd__device__subcmd__setting_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help device setting commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__help_commands] )) ||
_openscq30__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__list-models_commands] )) ||
_openscq30__subcmd__help__subcmd__list-models_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help list-models commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__paired-devices_commands] )) ||
_openscq30__subcmd__help__subcmd__paired-devices_commands() {
    local commands; commands=(
'add:Pair a device with openscq30' \
'remove:Remove a paired device' \
'list:List all currently paired devices' \
    )
    _describe -t commands 'openscq30 help paired-devices commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__paired-devices__subcmd__add_commands] )) ||
_openscq30__subcmd__help__subcmd__paired-devices__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help paired-devices add commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__paired-devices__subcmd__list_commands] )) ||
_openscq30__subcmd__help__subcmd__paired-devices__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help paired-devices list commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__help__subcmd__paired-devices__subcmd__remove_commands] )) ||
_openscq30__subcmd__help__subcmd__paired-devices__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 help paired-devices remove commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__list-models_commands] )) ||
_openscq30__subcmd__list-models_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 list-models commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices_commands] )) ||
_openscq30__subcmd__paired-devices_commands() {
    local commands; commands=(
'add:Pair a device with openscq30' \
'remove:Remove a paired device' \
'list:List all currently paired devices' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 paired-devices commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__add_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices add commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__help_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__help_commands() {
    local commands; commands=(
'add:Pair a device with openscq30' \
'remove:Remove a paired device' \
'list:List all currently paired devices' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'openscq30 paired-devices help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__help__subcmd__add_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__help__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices help add commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__help__subcmd__help_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices help help commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__help__subcmd__list_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__help__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices help list commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__help__subcmd__remove_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__help__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices help remove commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__list_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices list commands' commands "$@"
}
(( $+functions[_openscq30__subcmd__paired-devices__subcmd__remove_commands] )) ||
_openscq30__subcmd__paired-devices__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'openscq30 paired-devices remove commands' commands "$@"
}

if [ "$funcstack[1]" = "_openscq30" ]; then
    _openscq30 "$@"
else
    compdef _openscq30 openscq30
fi
