2011-03-19 09:58:42 -07:00
|
|
|
require 'formula'
|
2011-11-22 19:28:05 -06:00
|
|
|
require 'cmd/outdated'
|
2011-03-19 09:58:42 -07:00
|
|
|
|
|
|
|
def ff
|
|
|
|
if ARGV.include? "--all"
|
|
|
|
Formula.all
|
2011-09-11 16:23:39 -05:00
|
|
|
elsif ARGV.include? "--installed"
|
2011-11-22 19:28:05 -06:00
|
|
|
# outdated brews count as installed
|
|
|
|
outdated = Homebrew.outdated_brews.collect{ |b| b.name }
|
|
|
|
Formula.all.select do |f|
|
|
|
|
f.installed? or outdated.include? f.name
|
|
|
|
end
|
2011-03-19 09:58:42 -07:00
|
|
|
else
|
2012-02-04 00:01:29 -06:00
|
|
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
2011-03-19 09:58:42 -07:00
|
|
|
ARGV.formulae
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 21:32:10 -08:00
|
|
|
module Homebrew extend self
|
|
|
|
def options
|
2011-03-19 09:58:42 -07:00
|
|
|
ff.each do |f|
|
2011-09-11 16:22:45 -05:00
|
|
|
next if f.options.empty?
|
2011-03-10 21:32:10 -08:00
|
|
|
if ARGV.include? '--compact'
|
|
|
|
puts f.options.collect {|o| o[0]} * " "
|
|
|
|
else
|
|
|
|
puts f.name
|
|
|
|
f.options.each do |o|
|
|
|
|
puts o[0]
|
|
|
|
puts "\t"+o[1]
|
|
|
|
end
|
|
|
|
puts
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|