From 986dd76536187f0ad1a37f051d55c968db50689d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 30 Mar 2019 11:58:45 +0100 Subject: 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. --- lib/bundler/cli.rb | 26 ++++++++++++-------------- lib/bundler/feature_flag.rb | 1 - lib/bundler/settings.rb | 1 - man/bundle-config.ronn | 2 -- spec/commands/list_spec.rb | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index a8ae5ffc3e..a62750746f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -282,19 +282,19 @@ module Bundler end 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 + 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" - else + map %w[ls] => "list" + + 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. @@ -327,8 +327,6 @@ module Bundler require "bundler/cli/show" Show.new(options, gem_name).run end - - map %w[list] => "show" end desc "info GEM [OPTIONS]", "Show information for the given gem" 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}" -- cgit v1.2.1