cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: support exclusive/conflicting options

Open erezrokah opened this issue 2 years ago • 3 comments

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

erezrokah avatar Jan 07 '22 17:01 erezrokah

Being discussed in https://github.com/tj/commander.js/pull/1678

erezrokah avatar Jan 17 '22 13:01 erezrokah

https://github.com/tj/commander.js/pull/1678 got merged 🚀 so once released we should be able to move on this issue

erezrokah avatar Mar 07 '22 08:03 erezrokah

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:

  1. Looking as the code of the CLI before the switch to Commander.js
  2. Writing down the conflicting options
  3. Re-add any conflicting via the newly supported Commander.js feature

erezrokah avatar Mar 23 '22 13:03 erezrokah