diff options
| author | Jack Nagel | 2013-06-26 15:08:45 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-06-26 15:11:34 -0500 |
| commit | ce4b6218740bea2d9175ab268ef0ccadcb455741 (patch) | |
| tree | f1eac22c28f5283955920726078a7ffa26d04300 /Library/Homebrew/cmd/options.rb | |
| parent | 872cf44bbccec6f05c3f89e38bf67801c8d38a7d (diff) | |
| download | brew-ce4b6218740bea2d9175ab268ef0ccadcb455741.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 |
