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

bug(cli): mode flag accepts any value #1282

Closed
snitin315 opened this issue Mar 2, 2020 · 4 comments · Fixed by #1290
Closed

bug(cli): mode flag accepts any value #1282

snitin315 opened this issue Mar 2, 2020 · 4 comments · Fixed by #1290

Comments

@snitin315
Copy link
Member

Describe the bug

--mode is accepting any value and outputs development build. I can pass --mode=abcd , and it produces the build(development).

Screenshot from 2020-02-28 15-33-34

Expected behavior
It should accept only production , development or none

@anshumanv
Copy link
Member

In case of invalid mode value we can probably use dev mode as default and print a warning that the given mode is invalid so dev will be used by default.

@snitin315
Copy link
Member Author

I will work on this issue.

@anshumanv
Copy link
Member

Awesome, thanks!

@ematipico
Copy link
Contributor

You can use type to validate your argument.

https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md#module_option-definition--OptionDefinition+type

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

Successfully merging a pull request may close this issue.

3 participants