From 0cc3eb296d798e24907bdc9f1a0cc8debc412eb9 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 7 Nov 2011 22:46:36 -0600 Subject: cleanup: add an option to perform a 'dry run' Sometimes you want to know what `brew cleanup` will do before it actually removes anything. Introduce a '-n' option (chosen to match other UNIX tools) to do this. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/cleanup.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew') diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 0f9f2c3cb..0aec10f56 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -13,7 +13,7 @@ module Homebrew extend self end end # seems like a good time to do some additional cleanup - Homebrew.prune + Homebrew.prune unless ARGV.include? '-n' else ARGV.formulae.each do |f| cleanup_formula f @@ -36,7 +36,7 @@ module Homebrew extend self f.rack.children.each do |keg| if f.installed_prefix != keg print "Removing #{keg}..." - rm_rf keg + rm_rf keg unless ARGV.include? '-n' puts end end -- cgit v1.2.3