brew/Library/Homebrew/cmd/options.rb

29 lines
521 B
Ruby
Raw Normal View History

2011-03-19 09:58:42 -07:00
require 'formula'
def ff
if ARGV.include? "--all"
Formula.all
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|
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