diff options
| author | Jack Nagel | 2011-11-07 22:46:36 -0600 |
|---|---|---|
| committer | Jack Nagel | 2011-11-07 22:46:36 -0600 |
| commit | bc78e2b2504312e4eb20f71a0278b0afaaa1f424 (patch) | |
| tree | 556fcd06e86e61df6419c35539060cd11e7a9787 /Library | |
| parent | 3b0fbd6e09d0f481fbf9503a21ecb08a632f4144 (diff) | |
| download | homebrew-bc78e2b2504312e4eb20f71a0278b0afaaa1f424.tar.bz2 | |
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 <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/manpages/brew.1.md | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/cleanup.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index a15fbfeb7..806762a94 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -54,13 +54,15 @@ For the full command list, see the COMMANDS section. * `cat` <formula>: Display the source to <formula>. - * `cleanup [--force]` [<formula>]: + * `cleanup [--force] [-n]` [<formula>]: For all installed or specific formulae, remove any older versions from the cellar. By default, does not remove out-of-date keg-only brews, as other software may link directly to specific versions. If `--force` is passed, remove out-of-date keg-only brews as well. + If `-n` is passed, show what would be removed, but do not actually remove anything. + * `create [--autotools|--cmake] [--no-fetch]` <URL>: Generate a formula for the downloadable file at <URL> and open it in $EDITOR. Homebrew will attempt to automatically derive the formula name 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 |
