#compdef moosex-app-zsh

# Built with MooseX::App::Plugin::ZshCompletion::Command on 2016/05/14

_moosex-app-zsh() {
    typeset -A opt_args
    local curcontext="$curcontext" state line context

    _arguments -s \
        '1: :->subcmd' \
        '*: :->args' \
    && ret=0

    case $state in

    subcmd)
        compadd help bash_completion fetch_mail lala zsh_completion
    ;;

    args)
        curcontext="${curcontext%:*:*}:moosex-app-zsh-cmd-$words[1]:"

        case $line[1] in
    bash_completion)
        _moosex-app-zsh_bash_completion
    ;;
    fetch_mail)
        _moosex-app-zsh_fetch_mail
    ;;
    lala)
        _moosex-app-zsh_lala
    ;;
    zsh_completion)
        _moosex-app-zsh_zsh_completion
    ;;

        help)
            _moosex-app-zsh_help
        esac

    esac
}

_moosex-app-zsh_bash_completion() {
    _arguments -C \
    '1: :->subcmd' \
        '(--help -h --usage -?)'{--help,-h,--usage,-?}'[Prints this usage information.]' \
 && ret=0


}

_moosex-app-zsh_fetch_mail() {
    _arguments -C \
    '1: :->subcmd' \
    '2: :->server' \
        '--verbose[be verbose]' \
        '--servertype[Mailserver type: IMAP or POP3]:servertype:(IMAP POP3)' \
        '--max[Maximum number of emails to fetch]:max' \
        '--dir[Output '"'"'dir'"'"']:dir' \
        '--user[User]:user' \
        '(--help -h --usage -?)'{--help,-h,--usage,-?}'[Prints this usage information.]' \
 && ret=0

    curcontext="${curcontext%:*:*}:moosex-app-zsh-cmd-$words[1]:"

    case $state in
        server)
            _files
        ;;

    esac

}

_moosex-app-zsh_lala() {
    _arguments -C \
    '1: :->subcmd' \
    '2: :->foo' \
    '3: :->bar' \
    '4: :->boo' \
        '--verbose[be verbose]' \
        '(--help -h --usage -?)'{--help,-h,--usage,-?}'[Prints this usage information.]' \
 && ret=0

    curcontext="${curcontext%:*:*}:moosex-app-zsh-cmd-$words[1]:"

    case $state in
        foo)
            compadd -X 'foo' bar boo foo
        ;;
        bar)
            compadd -X 'bar' bar boo foo
        ;;
        boo)
            compadd -X 'boo' bar boo foo
        ;;

    esac

}

_moosex-app-zsh_zsh_completion() {
    _arguments -C \
    '1: :->subcmd' \
        '(--help -h --usage -?)'{--help,-h,--usage,-?}'[Prints this usage information.]' \
 && ret=0


}


_moosex-app-zsh_help() {
    compadd bash_completion fetch_mail lala zsh_completion
}



