aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/options.rb
blob: 273969c95b9a6a3801596eab7a0f3fe7c5cf5517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'formula'

def ff
  if ARGV.include? "--all"
    Formula.all
  else
    ARGV.formulae
  end
end

module Homebrew extend self
  def options
    ff.each do |f|
      f.options rescue next
      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