Skip to content

Inconsistent behavior when defining sub-command #256

@rrthomas

Description

@rrthomas

The documented API for defining a sub-command is:

  program
    .command('setup')
    .description('run remote setup commands')
    .action(function(){
      console.log('setup');
    });

This does not automatically call addImplicitHelpCommand. The undocumented form

 program.command('setup', 'run remote setup commands')

does. It would seem reasonable to move the code that sets the executables flag, which in turn causes addImplicitHelpCommand to be called, from the parse method into the description method. Would a patch to do this be acceptable?

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