#compdef cherryrgb_service

autoload -U is-at-least

_cherryrgb_service() {
    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[@]}" : \
'-p+[Must be specified if multiple cherry products are detected]:PRODUCT_ID:_default' \
'--product-id=[Must be specified if multiple cherry products are detected]:PRODUCT_ID:_default' \
'-s+[Path of listening socket to create]:socket:_files' \
'--socket=[Path of listening socket to create]:socket:_files' \
'-m+[Permissions of the socket (octal)]:socketmode:_default' \
'--socketmode=[Permissions of the socket (octal)]:socketmode:_default' \
'-g+[Group of the socket]:socketgroup:_default' \
'--socketgroup=[Group of the socket]:socketgroup:_default' \
'-d[Enable debug output]' \
'--debug[Enable debug output]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

(( $+functions[_cherryrgb_service_commands] )) ||
_cherryrgb_service_commands() {
    local commands; commands=()
    _describe -t commands 'cherryrgb_service commands' commands "$@"
}

if [ "$funcstack[1]" = "_cherryrgb_service" ]; then
    _cherryrgb_service "$@"
else
    compdef _cherryrgb_service cherryrgb_service
fi
