You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
this will only output
*** Foo invoked!
if the commandfoo
is specified in the command-line, but will not output*** Version printed!
ifversion
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?The text was updated successfully, but these errors were encountered: