#compdef ayllu-web

autoload -U is-at-least

_ayllu-web() {
    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+[]:FILE:_files' \
'--config=[]:FILE:_files' \
'-l+[logging level \[ERROR,WARN,INFO,DEBUG,TRACE\]]:LEVEL:_default' \
'--level=[logging level \[ERROR,WARN,INFO,DEBUG,TRACE\]]:LEVEL:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_ayllu-web_commands" \
"*::: :->ayllu-web" \
&& ret=0
    case $state in
    (ayllu-web)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ayllu-web-command-$line[1]:"
        case $line[1] in
            (serve)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_ayllu-web__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

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

(( $+functions[_ayllu-web_commands] )) ||
_ayllu-web_commands() {
    local commands; commands=(
'serve:Launch the web interface' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ayllu-web commands' commands "$@"
}
(( $+functions[_ayllu-web__subcmd__help_commands] )) ||
_ayllu-web__subcmd__help_commands() {
    local commands; commands=(
'serve:Launch the web interface' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ayllu-web help commands' commands "$@"
}
(( $+functions[_ayllu-web__subcmd__help__subcmd__help_commands] )) ||
_ayllu-web__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'ayllu-web help help commands' commands "$@"
}
(( $+functions[_ayllu-web__subcmd__help__subcmd__serve_commands] )) ||
_ayllu-web__subcmd__help__subcmd__serve_commands() {
    local commands; commands=()
    _describe -t commands 'ayllu-web help serve commands' commands "$@"
}
(( $+functions[_ayllu-web__subcmd__serve_commands] )) ||
_ayllu-web__subcmd__serve_commands() {
    local commands; commands=()
    _describe -t commands 'ayllu-web serve commands' commands "$@"
}

if [ "$funcstack[1]" = "_ayllu-web" ]; then
    _ayllu-web "$@"
else
    compdef _ayllu-web ayllu-web
fi
