-
Notifications
You must be signed in to change notification settings - Fork 171
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
Use parse! for OptionParser #958
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.
Should we report this is a bug (or documention issue) for OptionParser
? It seems very non-obvious.
The usage is documented here. You basically need to pass the arguments to It's not super intuitive when you compare the two usages, but I should have paid more attention to the docs. |
|
…d-patch-0fd7d1b0d4 Bump the minor-and-patch group with 3 updates
Motivation
In #905, we ended up deciding to go with
parse
instead ofparse!
because it didn't mutateARGV
. However, it also doesn't invoke theon
blocks and soruby-lsp --version
orruby-lsp --branch
don't work.Implementation
Changed the implementation to dup the
ARGV
first and then just usedparse!
.Automated Tests
I think we need to extract a
CLI
class to encapsulate all of these and make it easier to test. However, I don't think it's worth the investment immediately, let's just fix this for now and think about theCLI
later.