Use the first token of --chruby as the default name #244
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.
What's this?
I use
./run_benchmarks.rb --chruby 'before::before --yjit;after::after --yjit'
to compare two revisions. I use this so often that I want to make it a bit shorter.This PR allows you to use
--chruby 'before --yjit;after --yjit'
while keeping the namesbefore
andafter
, notbefore --yjit
andafter --yjit
as the current implementation would do.Why this change is safe
When you compare the interpreter and YJIT, you simply don't need to use
--chruby
in the first place. So, when you use--chruby
, you most likely specify differentchruby
binaries. Therefore it makes sense to use the first token of a--chruby
option as the name of the binary in most cases.Even if you want to specify the same chruby binary with different options in
--chruby
for whatever reason, you can still explicitly writename::
before specifying the chruby name and opptions.Also, I didn't update README.md because use cases written there work as is, and the use of
--chruby
is already explained well. This change is fairly backward-compatible in that sense too.