aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-06-13 12:59:18 +0100
committerMax Howell2009-06-13 12:59:18 +0100
commit92154225dc6b821caadc129625f2d887c5fef352 (patch)
tree2255ea429dcf67df13130bcb2ae30db5c6653949
parent530ab40bd5624d2abcd462626de9a1fdec117c34 (diff)
downloadbrew-92154225dc6b821caadc129625f2d887c5fef352.tar.bz2
brew info provides installation status
-rwxr-xr-xbin/brew34
1 files changed, 17 insertions, 17 deletions
diff --git a/bin/brew b/bin/brew
index 9c7651a7d..bbdb48bb6 100755
--- a/bin/brew
+++ b/bin/brew
@@ -170,8 +170,7 @@ Commands:
rm formula ...
list formula ...
ln formula ...
- info formula
- abv [formula]
+ info [formula]
mk url
prune
EOS
@@ -179,18 +178,13 @@ end
def abv keg=''
keg=$cellar+keg
+ return nil if not File.directory? keg
`find #{keg} -type f | wc -l`.strip+' files, '+`du -hd0 #{keg} | cut -d"\t" -f1`.strip
end
######################################################################### impl
begin
case ARGV.shift
- when 'abv'
- if ARGV.empty?
- puts abv
- else
- puts abv(shift_formulae_from_ARGV[0])
- end
when 'prune'
puts "Pruned #{prune} files"
when '--prefix'
@@ -278,16 +272,22 @@ begin
puts path
end
- when 'info'
- o=__obj shift_formulae_from_ARGV[0]
- puts "#{o.name} #{o.version}"
- puts o.homepage
- if o.caveats
- ohai 'Caveats'
- puts o.caveats
+ when 'info','abv'
+ if ARGV.empty?
+ puts abv
+ else
+ o=__obj shift_formulae_from_ARGV[0]
+ puts "#{o.name} #{o.version}"
+ puts o.homepage
+ if abv=abv(o.name)
+ ohai "Installation"
+ puts abv
+ end
+ if o.caveats
+ ohai 'Caveats'
+ puts o.caveats
+ end
end
- else
- puts usage
end
rescue StandardError, Interrupt => e