Skip to content

It looks not way to know has action is run? #977

@andares

Description

@andares
var program = require('commander');

program.version('0.1.0');

program
  .command('pat <dir>')
  .option('-o, --output', 'Output dir')
  .action((dir, command) => {
    console.log('POINT A')
  });

program
  .on('command:*', () => {
    console.log('POINT B')
  });

program.parse(process.argv)

console.log('POINT C')

in POINT A, I know command pat action is run. in POINT B, I know user send a error command. in POINT C, it means may be a action is run, or none command was be sent.

but I can not find a way to know just none command was be sent, unless I add callback after signal each action, there could be hundreds..

I think program object should provide some api to get there has action be called, and which action be called?

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