summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb10
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