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

Negated flags #1240

Closed
ematipico opened this issue Feb 19, 2020 · 11 comments · Fixed by #1668
Closed

Negated flags #1240

ematipico opened this issue Feb 19, 2020 · 11 comments · Fixed by #1668

Comments

@ematipico
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The CLI should support negated flags.

Describe the solution you'd like
The CLI should support same negated flags

  • --no-hot
  • --no-colors
  • --no-mode
@snitin315
Copy link
Member

@ematipico I would like to work on this issue. It would be great if you can point me to some reference or share any tip/prerequisite .

@rishabh3112
Copy link
Member

Thanks for trying to work on the issue.
You can look at how other flags are added in the CLI, that would be enough to get you working on the issue.
You can ask for more help here if you need in future 🙌

@snitin315
Copy link
Member

@rishabh3112 thanks , Looking into it.

@snitin315
Copy link
Member

@rishabh3112 correct me if I'm wrong the --no-mode flag should set mode = "none" .?

@ematipico
Copy link
Contributor Author

It depends on us. What do you think?

@snitin315
Copy link
Member

I think it should set mode = "none"

@ematipico
Copy link
Contributor Author

Sounds good :)

@snitin315
Copy link
Member

snitin315 commented Feb 27, 2020

@ematipico @rishabh3112 , I am able to add nomode or no_mode but I can't pass no-mode in the code below in zero-config.js like this -

function getEnvFromOptionsAndMode(mode, optionsObject) {
     const { dev, prod, no-mode } = optionsObject;

Whats the trick here to do so?

@anshumanv
Copy link
Member

- would be seen as an operator while destructuring since what you're destructuring is not a valid key, syntactically wrong.

Maybe add an alias variable for the flag like --no-mode stores a property is stored with key no_mode?

@snitin315
Copy link
Member

snitin315 commented Feb 27, 2020

I think I should make a PR and move the discussion over there.

@ematipico
Copy link
Contributor Author

As the file says, that's a file we use for covering the case the user doesn't use any configuration.

The reading and parsing of the new flag will occur inside the group you decide to put.

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

Successfully merging a pull request may close this issue.

4 participants