Skip to content

Support more than one level of subcommands #63

@balupton

Description

@balupton

Right now we can do this:

program = require('commander')

program
    .version('0.0.1')

program
    .command('plugin-create <name>')
    .description('create plugin')

program
    .command('plugin-delete <name>')
    .description('delete plugin')

which results with:


  Usage: woodchuck.js [options] [command]

  Commands:

    plugin-create <name>
    create plugin

    plugin-delete <name>
    delete plugin

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

But we can't do this:

program = require('commander')

program
    .version('0.0.1')

program
    .command('plugin create <name>')
    .description('create plugin')

program
    .command('plugin delete <name>')
    .description('delete plugin')

which results with:

  Usage: woodchuck.js [options] [command]

  Commands:

    plugin <name>
    create plugin

    plugin <name>
    delete plugin

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions