-
Notifications
You must be signed in to change notification settings - Fork 36
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
implement either :one, :two #130
Conversation
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.
LGTM - a small comment about preferring interpolation over concatenation. @kbrock Please also review.
Co-authored-by: Jason Frey <fryguy9@gmail.com>
This seems like a specialization of a more general type of argument validation. More specifically, the condition you are trying to satisfy with Was thinking something along the lines of: validate min: <Integer/nil>, max: <Integer/nil>, args: <Array of Symbol> Another related thought - @Fryguy should there any default notation in the help message for exclusivity clauses? If the developer uses |
While it might be nice to have a general case, that doesn't preclude having specialized methods, which are readable, and can later be implemented in terms of the generic code. For the help text I was thinking the same thing, but since |
I particularly liked the elegance of writing |
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.
I noticed there are no tests for the happy path.
Amusingly, typically people just test the working code and forget to test the problems. Seems you have done the opposite.
Just add a working example and then lets shipit
@kbrock I think the test lines that are calling |
@Fryguy LGTM. merge if you are all set |
Added - Implement `either` command (#130)
Makes at least one of the opts required, but fails if both or none are given.