diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-30 11:58:45 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-05 09:28:57 +0200 |
commit | f876e820ec204a2010d64a73e4f7e84b4d79e7ea (patch) | |
tree | df0920fc5698347c6539f1b932882b649f650316 | |
parent | bdc78428589547aec003e965302f1fcf985f18fa (diff) | |
download | bundler-f876e820ec204a2010d64a73e4f7e84b4d79e7ea.tar.gz |
Remove `list_command` setting
The list command was still present (just aliased to `bundle show`), even
if the setting was set to false. So the setting was at least super
confusing if not just wrong.
It also led to misleading situations such as
```
$ bundle list --help
(...)
NAME
bundle-list - List all the gems in the bundle
SYNOPSIS
bundle list [--name-only] [--paths] [--without-group=GROUP] [--only-group=GROUP]
(...)
$ bundle list --only-group=development
Unknown switches '--only-group=development'
```
So, instead, I enable the new list command _always_ and remove the
`bundle list => bundle show` alias.
-rw-r--r-- | lib/bundler/cli.rb | 26 | ||||
-rw-r--r-- | lib/bundler/feature_flag.rb | 1 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 1 | ||||
-rw-r--r-- | man/bundle-config.ronn | 2 | ||||
-rw-r--r-- | spec/commands/list_spec.rb | 2 |
5 files changed, 12 insertions, 20 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index c58d0875d5..7d0eb27363 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -282,7 +282,7 @@ module Bundler end end - unless Bundler.feature_flag.list_command? + unless Bundler.feature_flag.bundler_3_mode? desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem" long_desc <<-D Show lists the names and versions of all gems that are required by your Gemfile. @@ -315,24 +315,20 @@ module Bundler require "bundler/cli/show" Show.new(options, gem_name).run end - - map %w[list] => "show" end - 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" - method_option "only-group", :type => :string, :banner => "print gems from a particular group" - method_option "without-group", :type => :string, :banner => "print all gems expect from a group" - method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle" - def list - require "bundler/cli/list" - List.new(options).run - end - - map %w[ls] => "list" + desc "list", "List all gems in the bundle" + method_option "name-only", :type => :boolean, :banner => "print only the gem names" + method_option "only-group", :type => :string, :banner => "print gems from a particular group" + method_option "without-group", :type => :string, :banner => "print all gems expect from a group" + method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle" + def list + require "bundler/cli/list" + List.new(options).run end + map %w[ls] => "list" + desc "info GEM [OPTIONS]", "Show information for the given gem" method_option "path", :type => :boolean, :banner => "Print full path to gem" def info(gem_name) diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index fc3da1bbf4..04d8272195 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -41,7 +41,6 @@ module Bundler settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? } settings_flag(:global_gem_cache) { bundler_2_mode? } settings_flag(:init_gems_rb) { bundler_2_mode? } - settings_flag(:list_command) { bundler_3_mode? } settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? } settings_flag(:only_update_to_newer_versions) { bundler_2_mode? } settings_flag(:path_relative_to_cwd) { bundler_2_mode? } diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index a1c0825d39..bf709f712b 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -39,7 +39,6 @@ module Bundler global_gem_cache ignore_messages init_gems_rb - list_command lockfile_uses_separate_rubygems_sources no_install no_prune diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn index 9dc2edbf2a..4e717b4b69 100644 --- a/man/bundle-config.ronn +++ b/man/bundle-config.ronn @@ -214,8 +214,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html). Generate a `gems.rb` instead of a `Gemfile` when running `bundle init`. * `jobs` (`BUNDLE_JOBS`): The number of gems Bundler can install in parallel. Defaults to 1. -* `list_command` (`BUNDLE_LIST_COMMAND`) - Enable new list command feature * `no_install` (`BUNDLE_NO_INSTALL`): Whether `bundle package` should skip installing gems. * `no_prune` (`BUNDLE_NO_PRUNE`): diff --git a/spec/commands/list_spec.rb b/spec/commands/list_spec.rb index c988d16d3a..613249cc59 100644 --- a/spec/commands/list_spec.rb +++ b/spec/commands/list_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle list", :bundler => "3" do +RSpec.describe "bundle list", :bundler => ">= 2" do before do install_gemfile <<-G source "file://#{gem_repo1}" |