-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Interface enhancements for cake (#1862) #1866
Conversation
try | ||
options = oparse.parse(args) | ||
catch e | ||
return badArgument "#{e}".match(/option: (.+)/)[1], "option" |
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 don't like this. We can't just pass along the error given by OptionParser?
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've added a commit to do this, though with some hesitation. This produces the output
Error: unrecognized option: --help
instead of the simpler and more consistent
No such option: "--help"
LGTM |
Cool, merging. |
Interface enhancements for cake (#1862)
On the current master, while using an invalid task name produces a simple message, an invalid option (flag) produces a stack trace, because the exception thrown by
OptionParser
isn't caught (#1862). This pull request corrects that, instead producing, for example:The other thing this patch does is preface the task list with a message like this:
This becomes useful when the relevant
Cakefile
is in a parent directory (feature introduced by #1687), as it will then saymaking things much easier for folks with a hierarchy of
Cakefile
s.