summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-08-11 14:07:47 +0000
committerThe Bundler Bot <bot@bundler.io>2017-08-11 14:07:47 +0000
commit619dc63a797986e49e19d48ceae3b249fa3d8a5f (patch)
treeb10f82368cb10468ad961c158d03629223153220 /lib/bundler/cli.rb
parent14e7da3dbecc26fb92411d64287dac9f22b5e7fc (diff)
parent5d22dbe1d49826cc5f7108d95e6981b1ed15c5d8 (diff)
downloadbundler-619dc63a797986e49e19d48ceae3b249fa3d8a5f.tar.gz
Auto merge of #5920 - bundler:colby/bundler-list, r=segiddins
implement new list command ### What was the end-user problem that led to this PR? We're removing the `bundle show` command (which has been replaced with `bundle info`) but we should probably still have a command to list the gems in the bundle. ### What was your diagnosis of the problem? `bundle show` has been marked as deprecated but a replacement for listing gems does not yet exist ### What is your fix for the problem, implemented in this PR? Add a new `bundle list` (including `ls` alias) that prints the gems in the bundle, this was taken from #4754
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 0d559a8f76..2adbac403e 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -261,7 +261,19 @@ module Bundler
Show.new(options, gem_name).run
end
# TODO: 2.0 remove `bundle show`
- map %w[list] => "show"
+
+ if Bundler.feature_flag.list_command?
+ desc "list", "List all gems in the bundle"
+ method_option "name-only", :type => :boolean, :banner => "print only the gem names"
+ def list
+ require "bundler/cli/list"
+ List.new(options).run
+ end
+
+ map %w[ls] => "list"
+ else
+ map %w[list] => "show"
+ end
desc "info GEM [OPTIONS]", "Show information for the given gem"
method_option "path", :type => :boolean, :banner => "Print full path to gem"