-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
When calling program.parse(process.argv);, I would like to know if any command was processed. Meaning, if the program was invoked with either -h, --help, version or any other command.
For example, if I have this setup
program.command('foo')
....
;
program.once('foo', function () { console.log('*** Foo invoked!'); });
program.once('version', function () { console.log('*** Version printed');
this will only output *** Foo invoked! if the command foo is specified in the command-line, but will not output *** Version printed! if version is specified.
Bottom line is that, I'd that, right after program.parse(process.argv);, to know whether anything happened (any output, any command processed, etc.) or not. How can I uniformingly do this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels