Skip to content
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

Enhancement: Mandatory options #1086

Closed
ace130-github opened this issue Oct 31, 2019 · 3 comments
Closed

Enhancement: Mandatory options #1086

ace130-github opened this issue Oct 31, 2019 · 3 comments
Milestone

Comments

@ace130-github
Copy link

I would like to mark certain options as mandatory.
When such an option (along with a value, if so defined) is not present then the program would print the help to the console and exit (just like when you specify an option with a mandatory parameter by angle brackets).

I would like to use this feature e.g. to pass credentials to a program that can't work without them, eg
importToDatabase.js -u <username> -p <password> -d <databaseUrl>

@shadowspawn
Copy link
Collaborator

Thanks for the example. You are in luck! See #1071 for more details.

This is available now in a prerelease: https://github.com/tj/commander.js/releases/tag/v4.0.0-1

We are planning to release v4 this weekend.

@shadowspawn shadowspawn added this to the v4.0.0 milestone Oct 31, 2019
@shadowspawn
Copy link
Collaborator

v4.0.0 has been released.

@ace130-github
Copy link
Author

Thanks a lot, this is good news! And sorry for not searching through the existing issues carefully enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants