lib/rubygems/commands/cleanup_command.rb in rubygems-update-3.2.0.rc.1 vs lib/rubygems/commands/cleanup_command.rb in rubygems-update-3.2.0.rc.2

- old
+ new

@@ -2,22 +2,27 @@ require 'rubygems/command' require 'rubygems/dependency_list' require 'rubygems/uninstaller' class Gem::Commands::CleanupCommand < Gem::Command - def initialize super 'cleanup', 'Clean up old versions of installed gems', :force => false, :install_dir => Gem.dir, :check_dev => true - add_option('-n', '-d', '--dryrun', + add_option('-n', '-d', '--dry-run', 'Do not uninstall gems') do |value, options| options[:dryrun] = true end + add_option(:Deprecated, '--dryrun', + 'Do not uninstall gems') do |value, options| + options[:dryrun] = true + end + deprecate_option('--dryrun', extra_msg: 'Use --dry-run instead') + add_option('-D', '--[no-]check-development', 'Check development dependencies while uninstalling', '(default: true)') do |value, options| options[:check_dev] = value end @@ -40,11 +45,11 @@ def arguments # :nodoc: "GEMNAME name of gem to cleanup" end def defaults_str # :nodoc: - "--no-dryrun" + "--no-dry-run" end def description # :nodoc: <<-EOF The cleanup command removes old versions of gems from GEM_HOME that are not @@ -179,7 +184,6 @@ end ensure # Restore path Gem::Uninstaller may have changed Gem.use_paths @original_home, *@original_path end - end