Skip to content

Improvements to CLI parsers #3034

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

Merged

Conversation

steven-supersolid
Copy link
Contributor

Allow numberOrBooleanParser to parse a string correctly so parse-server -cluster true will now work. In a quick test, all cli options are typed as strings, e.g. null, true, 2. Not sure if this is platform/nodejs version specific though.

Improve error message in numberParser, e.g. parse-server -cluster fail will be Key cluster has invalid value fail instead of The cluster is invalid

Add env variable PARSE_SERVER_CLUSTER for cluster, because we want to set this per environment.

Added some basic tests to clarify existing parser behavior.

…message in numberParser. Add env variable PARSE_SERVER_CLUSTER for cluster. Add tests
@flovilmart
Copy link
Contributor

LGTM! Thanks!

all cli options are typed as strings

Yes they are, it's an array of strings that commander gets.

@steven-supersolid
Copy link
Contributor Author

OK so is there any point parsers doing type checking or checking for non-string values? Happy to clean up as part of this PR

@flovilmart
Copy link
Contributor

uhmmm, I believe the parsers are used for json/js config files, but I'm not sure

@flovilmart flovilmart merged commit 5082609 into parse-community:master Nov 11, 2016
@steven-supersolid steven-supersolid deleted the steven.parsers.improvement branch November 14, 2016 14:21
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 this pull request may close these issues.

4 participants