#compdef goxlr-daemon

autoload -U is-at-least

_goxlr-daemon() {
    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[@]}" : \
'--log-level=[Minimum log level to print out]:LOG_LEVEL:((off\:"A level lower than all log levels"
error\:"Corresponds to the \`Error\` log level"
warn\:"Corresponds to the \`Warn\` log level"
info\:"Corresponds to the \`Info\` log level"
debug\:"Corresponds to the \`Debug\` log level"
trace\:"Corresponds to the \`Trace\` log level"))' \
'--config=[Location of the daemon configuration file on disk]:CONFIG:_files' \
'--http-port=[Define the port the HTTP Server should listen on]:HTTP_PORT:_default' \
'--http-bind-address=[Set the HTTP Bind Address (0.0.0.0 for all interfaces)]:HTTP_BIND_ADDRESS:_default' \
'--disable-tray=[Disable the Tray Icon]:DISABLE_TRAY:(true false)' \
'--override-sample-input-device=[Force regular expression to use when finding the Sampler Input]:OVERRIDE_SAMPLE_INPUT_DEVICE:_default' \
'--override-sample-output-device=[Force regular expression to use when finding the Sampler Output]:OVERRIDE_SAMPLE_OUTPUT_DEVICE:_default' \
'--http-disable[Disable the HTTP Server and Client Web UI]' \
'--http-enable-cors[Enable CORS on the HTTP Server to allow cross-origin communication]' \
'--force-root[Force Run the Daemon as Root]' \
'--start-ui[Automatically Launch the UI on Start..]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

(( $+functions[_goxlr-daemon_commands] )) ||
_goxlr-daemon_commands() {
    local commands; commands=()
    _describe -t commands 'goxlr-daemon commands' commands "$@"
}

if [ "$funcstack[1]" = "_goxlr-daemon" ]; then
    _goxlr-daemon "$@"
else
    compdef _goxlr-daemon goxlr-daemon
fi
