-
Notifications
You must be signed in to change notification settings - Fork 30
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
run: Simplify passing parameters on the command line #118
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We'd like to do type conversion live and throw an error.
We don't want to throw an error when the parameter doesn't exist but return the default value. Ensure that the behaviour is tested.
It's not actually a fd leak, but might as well do it properly.
Having typed input parameters on the command line seems a bit overkill and leads to a poor UX. We already define the type of the parameter in code, we can keep that as the canonical type we want and coerce strings from the command line into the right type. Fixes: #102
This gives more visibility into what's going wrong. Error: invalid type for param 'mybool': cannot convert "foo" to bool
dlespiau
force-pushed
the
2019-02-04-moar-params-work
branch
from
February 4, 2019 19:12
67002b4
to
efc820e
Compare
squaremo
approved these changes
Feb 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
At the moment, the failure condition looks like: Error: Should be true Adding more details can help understanding what's going wrong, eg. Error: Should be true Messages: fork/exec : no such file or directory
Added a small improvement to the e2e tests that I stumbled onto when adding the new test in this PR. Will merge once the tests pass. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Having typed input parameters on the command line seems a bit overkill and leads to a poor UX. We already define the type of the parameter in code, we can keep that as the canonical type we want and coerce strings from the command line into the right type.
Specifying an input parameter on the command line now looks like:
There was a bit of work to get there:
std.param
back to the js sideFixes: #102