diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-10-01 19:54:25 -0300 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-10-01 21:26:59 -0300 |
commit | fefd4c970f0c7010722213be2358bbc794e47241 (patch) | |
tree | 187281184c94caf8b1962b5126a73ff787e5dff9 /lib/bundler/cli.rb | |
parent | 9deb5447da89453c22686819782b034e62583b6b (diff) | |
download | bundler-fefd4c970f0c7010722213be2358bbc794e47241.tar.gz |
Fix "bundle show" deprecation messages
With a single gem, it will be replaced by `bundle info`, not by `bundle
list`.
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r-- | lib/bundler/cli.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 53241b15f6..55c3ebf2d3 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -290,7 +290,15 @@ module Bundler method_option "outdated", :type => :boolean, :banner => "Show verbose output including whether gems are outdated." def show(gem_name = nil) - Bundler::SharedHelpers.major_deprecation(2, "use `bundle list` instead of `bundle show`") if ARGV[0] == "show" + if ARGV[0] == "show" + rest = ARGV[1..-1] + alternative = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list" + + old_argv = ARGV.join(" ") + new_argv = [alternative, *rest].join(" ") + + Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`") + end require "bundler/cli/show" Show.new(options, gem_name).run end |