Move --cache command down near --prefix and use AGRV.formulae.

This commit is contained in:
Adam Vandenberg 2010-03-03 09:41:05 -08:00
parent 5fc319236f
commit 9f46adeeab

View File

@ -13,16 +13,6 @@ $:.unshift(HOMEBREW_LIBRARY_PATH)
require 'global' require 'global'
case ARGV.first case ARGV.first
when '--cache'
if ARGV.named.empty?
puts HOMEBREW_CACHE
else
require 'formula'
ARGV.named.each do |name|
puts Formula.factory(name).cached_download rescue '(built from source control)'
end
end
exit 0
when '-h', '--help', '--usage', '-?', 'help', nil when '-h', '--help', '--usage', '-?', 'help', nil
puts ARGV.usage puts ARGV.usage
exit 0 exit 0
@ -80,13 +70,18 @@ begin
require 'brew.h' require 'brew.h'
case arg = ARGV.shift case arg = ARGV.shift
when '--cache'
if ARGV.named.empty?
puts HOMEBREW_CACHE
else
puts *ARGV.formulae.collect {|f| f.cached_download rescue '(built from source control)'}
end
when '--prefix' when '--prefix'
if ARGV.named.empty? if ARGV.named.empty?
puts HOMEBREW_PREFIX puts HOMEBREW_PREFIX
else else
puts *ARGV.formulae.collect {|f| f.prefix} puts *ARGV.formulae.collect {|f| f.prefix}
end end
when '--repository' when '--repository'
puts HOMEBREW_REPOSITORY puts HOMEBREW_REPOSITORY
when '--cellar' when '--cellar'