-
Notifications
You must be signed in to change notification settings - Fork 18
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
Skip alias versions by default, add --aliases. #19
base: master
Are you sure you want to change the base?
Conversation
if [ -n "$aliases" ]; then | ||
opts= | ||
else | ||
opts="--skip-aliases" |
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.
This is a feature only available in edge version of rbenv. We could only potentially ship this PR after rbenv 1.0 gets released. Also, we should ensure that rbenv each
keeps working even with rbenv 0.4 for people who didn't upgrade.
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.
Right, that makes sense. Do you already have something in mind for how to do version detection?
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.
Hm, now that I look at rbenv versions
argument handling in v0.4.0, it looks like it only recognizes --bare
as 1st argument and ignores everything else. So I'm pretty sure that calling rbenv-versions --bare --skip-aliases
will be safe for all rbenv versions, but of course only rbenv 1.0 will respect --skip-aliases
.
Thanks for suggesting this change. I generally support the idea, but I'd like to first ship rbenv 1.0 and other PRs to this repo before this one. |
Cool, thanks. Let me know if I can help. |
-v|--verbose) | ||
verbose=1 | ||
;; | ||
-a|--aliases) |
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.
Could we rename the option to --with-aliases
so its name more closely suggests what it does?
Rbenv 1.0 has shipped and we could use this feature. Could you rebase your PR so it's mergeable? Thanks! |
By default, skip ruby versions that are aliases. I'm having a hard time thinking of any reason you would want to run the command on the same ruby version multiple times by default. Also tweak the option parsing and usage messages in support of this change. With versions `2.1 => 2.1.7`, `2.1.6`, and `2.1.7`: $ rbenv each ruby --version ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux] ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux] $ rbenv each --with-aliases ruby --version ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux] ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux] ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux]
Rebased & changed option name to |
@@ -2,36 +2,60 @@ | |||
# | |||
# Summary: Execute a command for each Ruby version | |||
# | |||
# Usage: rbenv each [-v] <command> [arg1 arg2...] | |||
# Usage: rbenv each [options] <command> [arg1 arg2...] |
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 wanted this to say [-va]
instead of options
but I realized that our option parsing doesn't support combining multiple shorthand flags together. So these docs will do for now.
Anything else needed here? |
Ping |
By default, skip ruby versions that are aliases. I'm having a hard time
thinking of any reason you would want to run the command on the same
ruby version multiple times by default.
Also tweak the option parsing and usage messages in support of this
change.
With versions
2.1 => 2.1.7
,2.1.6
, and2.1.7
:Happy to revise / edit this PR as desired.