diff options
| author | Jack Nagel | 2013-06-26 15:08:45 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2013-06-26 15:11:34 -0500 | 
| commit | e4468baae335d79713bed0f214858daf4836c703 (patch) | |
| tree | 3fb63a7c8633cb8ecc0e2daa1d8bb222096576f9 /Library/Homebrew/cmd/options.rb | |
| parent | 05c9222b5b9b86a6cf24b7dd6dd47dc5e4e8998b (diff) | |
| download | homebrew-e4468baae335d79713bed0f214858daf4836c703.tar.bz2 | |
Clean up `brew options`
Diffstat (limited to 'Library/Homebrew/cmd/options.rb')
| -rw-r--r-- | Library/Homebrew/cmd/options.rb | 29 | 
1 files changed, 12 insertions, 17 deletions
| diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 61b876e2f..641f9dce1 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -1,29 +1,24 @@  require 'formula' -require 'cmd/outdated' -def ff -  if ARGV.include? "--all" -    Formula.to_a -  elsif ARGV.include? "--installed" -    # outdated brews count as installed -    outdated = Homebrew.outdated_brews.collect{ |b| b.name } -    Formula.select do |f| -      f.installed? or outdated.include? f.name +module Homebrew extend self +  def options +    if ARGV.include? '--all' +      puts_options Formula.to_a +    elsif ARGV.include? '--installed' +      puts_options Formula.installed +    else +      raise FormulaUnspecifiedError if ARGV.named.empty? +      puts_options ARGV.formulae      end -  else -    raise FormulaUnspecifiedError if ARGV.named.empty? -    ARGV.formulae    end -end -module Homebrew extend self -  def options -    ff.each do |f| +  def puts_options(formulae) +    formulae.each do |f|        next if f.build.empty?        if ARGV.include? '--compact'          puts f.build.as_flags.sort * " "        else -        puts f.name if ff.length > 1 +        puts f.name if formulae.length > 1          dump_options_for_formula f          puts        end | 
