Add remove --force

This commit is contained in:
Adam Vandenberg 2010-10-17 17:52:10 -07:00
parent cdf35d1d8d
commit 266b3265aa
3 changed files with 31 additions and 10 deletions

View File

@ -99,9 +99,12 @@ didn't include with OS X.
* `home` <formula>:
Opens a browser to <formula>'s homepage.
* `rm`, `remove` <formula>:
* `rm`, `remove [--force]` <formula>:
Uninstalls <formula>.
If `--force` is passed, and there are multiple versions of <formula>
installed, deletes all installed versions.
* `create [--cache]` <URL>:
Generates a formula for the downloadable file at <URL> and opens it in
$EDITOR. Homebrew will attempt to automatically derive the formula name

View File

@ -188,6 +188,20 @@ begin
ARGV.kegs.each {|keg| puts "#{keg.unlink} links removed for #{keg}"}
when 'rm', 'uninstall', 'remove'
if ARGV.flag? "--force"
require 'formula'
ARGV.formulae.each do |f|
formula_cellar = f.prefix.parent
next unless File.exist? formula_cellar
puts "Uninstalling #{f.name}..."
formula_cellar.children do |k|
keg = Keg.new(k)
keg.unlink
end
formula_cellar.rmtree
end
else
begin
ARGV.kegs.each do |keg|
puts "Uninstalling #{keg}..."
@ -198,6 +212,7 @@ begin
onoe e
puts "Use `brew remove --force #{e.name}` to remove all versions."
end
end
when 'prune'
prune

View File

@ -105,9 +105,12 @@ Opens a browser to Homebrew\'s own homepage\.
Opens a browser to \fIformula\fR\'s homepage\.
.
.TP
\fBrm\fR, \fBremove\fR \fIformula\fR
\fBrm\fR, \fBremove [\-\-force]\fR \fIformula\fR
Uninstalls \fIformula\fR\.
.
.IP
If \fB\-\-force\fR is passed, and there are multiple versions of \fIformula\fR installed, deletes all installed versions\.
.
.TP
\fBcreate [\-\-cache]\fR \fIURL\fR
Generates a formula for the downloadable file at \fIURL\fR and opens it in $EDITOR\. Homebrew will attempt to automatically derive the formula name and version, if it fails, you\'ll have to make your own template\. I suggest copying wget\'s\.