cli
cli copied to clipboard
feat: support exclusive/conflicting options
Is your feature request related to a problem? Please describe.
Before the switch from oclif
to commander
we could configure exclusive
options, see https://github.com/netlify/cli/blob/f3dc4ed1eb5d5e9abcc5dea8c85b7c8acd67555e/src/commands/deploy.js#L622
That is, we could configure to report an error when a user tries to use options that won't make sense together.
commander
doesn't seem to support it, based on https://github.com/tj/commander.js/issues/1358#issuecomment-695149256
Describe the solution you'd like
A ability to configure conflicting/exclusive options.
Describe alternatives you've considered
N/A
Additional context
We can implement this in a custom way in the CLI repo, or contribute to commander
Can you submit a pull request?
Yes
Being discussed in https://github.com/tj/commander.js/pull/1678
https://github.com/tj/commander.js/pull/1678 got merged 🚀 so once released we should be able to move on this issue
This is now built-in into Commander.js, see https://github.com/tj/commander.js/releases/tag/v9.1.0.
Marking this good first issue
as it should be fairly easy to implement now by:
- Looking as the code of the CLI before the switch to Commander.js
- Writing down the conflicting options
- Re-add any conflicting via the newly supported Commander.js feature