2011-03-19 09:58:42 -07:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
def ff
|
|
|
|
if ARGV.include? "--all"
|
|
|
|
Formula.all
|
2011-09-11 16:23:39 -05:00
|
|
|
elsif ARGV.include? "--installed"
|
|
|
|
Formula.all.reject{ |f| not f.installed? }
|
2011-03-19 09:58:42 -07:00
|
|
|
else
|
|
|
|
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
|