-
Notifications
You must be signed in to change notification settings - Fork 0
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
Default command would be helpful #2
Comments
What do you mean with “default command”? |
@dyedgreen Description updated. Sorry, got distracted when creating this. |
Thoughts on this? |
Yep, I think having something like this is a good idea! Would you be open to contributing this as a PR? |
Ok, if you're not opposed to the feature I will try. |
Did anything come out of this idea? |
No sorry I didn't have time and forgot to followup. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could see it being solved a couple of ways but below is one way to illustrate the suggestion. Basically add an options object to the
.subcommand(name, command, opts)
function which has{ default: boolean }
.If more than one subcommand is set as default then an error is thrown.
When parsing the command if no subcommand is matched then the default command is selected and parsing continues with that command.
Example Usage
The text was updated successfully, but these errors were encountered: