API-CLI

 view release on metacpan or  search on metacpan

examples/zsh/_metacpancl  view on Meta::CPAN

#compdef metacpancl

_metacpancl() {
    local program=metacpancl
    typeset -A opt_args
    local curcontext="$curcontext" state line context


        # ---- Command: 
        _arguments -s  \
            '1: :->cmd1' \
            '*: :->args' \
            && ret=0


        case $state in
        cmd1)
            _alternative 'args:cmd2:((GET\:"GET call" POST\:"POST call" help\:"Show command help"))'
        ;;

        args)
            case $line[1] in
            GET)

                # ---- Command: GET
                _arguments -s -C \
                    '1: :->cmd1' \
                    '2: :->cmd2' \
                    '*: :->args' \
                    && ret=0


                case $state in
                cmd2)
                    _alternative 'args:cmd3:((/author/\\:author\:"Author information" /distribution/\\:distribution\:"Distribution information not specific to a version..." /module/\\:module\:"Module information" /pod/\\:module\:"Module POD" /release...
                ;;

                args)
                    case $line[2] in
                    /author/:author)

                        # ---- Command: GET /author/:author
                        _arguments -s -C \
                            '1: :->cmd1' \
                            '2: :->cmd2' \
                            '3: :->author' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            && ret=0

                        case $state in
                        author)

                        ;;
                        esac

                    ;;
                    /distribution/:distribution)

                        # ---- Command: GET /distribution/:distribution

examples/zsh/_metacpancl  view on Meta::CPAN

                            '1: :->cmd1' \
                            '2: :->cmd2' \
                            '3: :->author' \
                            '4: :->release' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            && ret=0

                        case $state in
                        author)

                        ;;
                        release)

                        ;;
                        esac

                    ;;
                    /release/:distribution)

                        # ---- Command: GET /release/:distribution
                        _arguments -s -C \
                            '1: :->cmd1' \
                            '2: :->cmd2' \
                            '3: :->distribution' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            && ret=0

                        case $state in
                        distribution)

                        ;;
                        esac

                    ;;
                    /release/_search)

                        # ---- Command: GET /release/_search
                        _arguments -s -C \
                            '1: :->cmd1' \
                            '2: :->cmd2' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            '--q-q[query ("author:ANDK AND status:latest")]:q-q' \
                            '--q-fields[resultset fields]:q-fields' \
                            '--q-size[how many results]:q-size' \
                            && ret=0


                    ;;
                    esac

                ;;

                esac
            ;;
            POST)

                # ---- Command: POST
                _arguments -s -C \
                    '1: :->cmd1' \
                    '2: :->cmd2' \
                    '*: :->args' \
                    && ret=0


                case $state in
                cmd2)
                    _alternative 'args:cmd3:((/file\:"file"))'
                ;;

                args)
                    case $line[2] in
                    /file)

                        # ---- Command: POST /file
                        _arguments -s -C \
                            '1: :->cmd1' \
                            '2: :->cmd2' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            && ret=0


                    ;;
                    esac

                ;;

                esac
            ;;
            _meta)

                # ---- Command: _meta
                _arguments -s -C \
                    '1: :->cmd1' \
                    '2: :->cmd2' \
                    '*: :->args' \
                    && ret=0



( run in 0.518 second using v1.01-cache-2.11-cpan-39bf76dae61 )