brew info provides installation status
This commit is contained in:
parent
530ab40bd5
commit
92154225dc
34
bin/brew
34
bin/brew
@ -170,8 +170,7 @@ Commands:
|
|||||||
rm formula ...
|
rm formula ...
|
||||||
list formula ...
|
list formula ...
|
||||||
ln formula ...
|
ln formula ...
|
||||||
info formula
|
info [formula]
|
||||||
abv [formula]
|
|
||||||
mk url
|
mk url
|
||||||
prune
|
prune
|
||||||
EOS
|
EOS
|
||||||
@ -179,18 +178,13 @@ end
|
|||||||
|
|
||||||
def abv keg=''
|
def abv keg=''
|
||||||
keg=$cellar+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
|
`find #{keg} -type f | wc -l`.strip+' files, '+`du -hd0 #{keg} | cut -d"\t" -f1`.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################### impl
|
######################################################################### impl
|
||||||
begin
|
begin
|
||||||
case ARGV.shift
|
case ARGV.shift
|
||||||
when 'abv'
|
|
||||||
if ARGV.empty?
|
|
||||||
puts abv
|
|
||||||
else
|
|
||||||
puts abv(shift_formulae_from_ARGV[0])
|
|
||||||
end
|
|
||||||
when 'prune'
|
when 'prune'
|
||||||
puts "Pruned #{prune} files"
|
puts "Pruned #{prune} files"
|
||||||
when '--prefix'
|
when '--prefix'
|
||||||
@ -278,16 +272,22 @@ begin
|
|||||||
puts path
|
puts path
|
||||||
end
|
end
|
||||||
|
|
||||||
when 'info'
|
when 'info','abv'
|
||||||
o=__obj shift_formulae_from_ARGV[0]
|
if ARGV.empty?
|
||||||
puts "#{o.name} #{o.version}"
|
puts abv
|
||||||
puts o.homepage
|
else
|
||||||
if o.caveats
|
o=__obj shift_formulae_from_ARGV[0]
|
||||||
ohai 'Caveats'
|
puts "#{o.name} #{o.version}"
|
||||||
puts o.caveats
|
puts o.homepage
|
||||||
|
if abv=abv(o.name)
|
||||||
|
ohai "Installation"
|
||||||
|
puts abv
|
||||||
|
end
|
||||||
|
if o.caveats
|
||||||
|
ohai 'Caveats'
|
||||||
|
puts o.caveats
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
puts usage
|
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue StandardError, Interrupt => e
|
rescue StandardError, Interrupt => e
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user