New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should 'command:*' and command('*') be removed from README? #1090
Comments
I would like to do further investigation and work around 'command:*' actions and handling, but this issue isn't likely to prompt that work. Closing to reduce issue noise. |
I want to add a listener(do some checking, like version-check) on every command created. // not work
program.on('command:init', function (operands) {
console.log('on command: init')
});
program.on('init', function(){
console.log('on init')
}) Thanks for help! |
There is not a hook called before actions. The related open issue is: #1197
If that does not help, then open a new issue so some visibility on question and answer instead of hidden away here. 😄 |
We have two examples of using command+* in the README but perhaps not a good pattern to encourage. I wonder whether we should remove them and suggest or provide better alternatives.
This works nicely in some cases, but is not a general solution:
command:*
It might be an ok pattern for a subset of cases and could expand comments so clearer not a general pattern.
See also: #1088
This example predates the ability to add arguments to the program using
.arguments()
, which might make for a tidier example, and more consistent with (sub)command action handlers.Somewhat related is a request for allowing an action based command as default command #742
The text was updated successfully, but these errors were encountered: