App-Spec

 view release on metacpan or  search on metacpan

examples/bash/myapp.bash  view on Meta::CPAN

    MYWORDS=("${words[@]:1:$cword}")

    FLAGS=('--verbose' 'be verbose' '-v' 'be verbose' '--help' 'Show command help' '-h' 'Show command help')
    OPTIONS=('--format' 'Format output')
    __myapp_handle_options_flags

    case $INDEX in

    0)
        __comp_current_options || return
        __myapp_dynamic_comp 'commands' 'config'$'\t''configuration'$'\n''convert'$'\t''Various unit conversions'$'\n''cook'$'\t''Cook something'$'\n''data'$'\t''output some data'$'\n''help'$'\t''Show command help'$'\n''palindrome'$'\t''Check if a st...

    ;;
    *)
    # subcmds
    case ${MYWORDS[0]} in
      _meta)
        __myapp_handle_options_flags
        case $INDEX in

        1)

examples/html/myapp.html  view on Meta::CPAN


<pre><code>    type    *    The type of unit to convert    
    source  *    The source unit to convert from
    value   *    The value to convert           
    target  * [] The target unit (multiple)     </code></pre>

<h3 id="cook">cook</h3>

<pre><code>    myapp  cook [options] &lt;drink&gt;</code></pre>

<p>Cook something</p>

<p>Options:</p>

<pre><code>    --with        Drink with ...  
    --sugar -s    add sugar (flag)</code></pre>

<p>Parameters:</p>

<pre><code>    drink  *  What to drink</code></pre>

examples/myapp-spec.yaml  view on Meta::CPAN

options:
  -
    name: verbose
    summary: be verbose
    type: flag
    multiple: true
    aliases: ["v"]

subcommands:
  cook:
    summary: Cook something
    op: cook
    parameters:
      -
        name: drink
        summary: What to drink
        required: true
        type: string
        enum: ["tea", "coffee"]
    options:
      -

examples/pod/myapp.pod  view on Meta::CPAN


    type    *    The type of unit to convert    
    source  *    The source unit to convert from
    value   *    The value to convert           
    target  * [] The target unit (multiple)     

=head3  cook

    myapp  cook [options] <drink>

Cook something

Options:

    --with        Drink with ...  
    --sugar -s    add sugar (flag)

Parameters:

    drink  *  What to drink

examples/zsh/_myapp  view on Meta::CPAN


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


        case $state in
        cmd1)
            _alternative 'args:cmd2:((config\:"configuration" convert\:"Various unit conversions" cook\:"Cook something" data\:"output some data" help\:"Show command help" palindrome\:"Check if a string is a palindrome" weather\:"Weather"))'
        ;;

        args)
            case $line[1] in
            _meta)

                # ---- Command: _meta
                _arguments -s -C \
                    '1: :->cmd1' \
                    '2: :->cmd2' \



( run in 0.365 second using v1.01-cache-2.11-cpan-e9199f4ba4c )