diff options
| author | Jack Nagel | 2011-11-22 19:28:05 -0600 |
|---|---|---|
| committer | Jack Nagel | 2011-11-22 19:29:10 -0600 |
| commit | 75a7c33e6aac30db7827ef3f1076b282057fff5b (patch) | |
| tree | eff059f450515bd97cd7d5993b115d9f973b010e /Library/Homebrew/cmd/options.rb | |
| parent | b62bd90a1d26d456ec66b31f2170362844c8808d (diff) | |
| download | brew-75a7c33e6aac30db7827ef3f1076b282057fff5b.tar.bz2 | |
options: treat outdated brews as installed
`brew options --installed` will now "do the right thing".
There is getting to be a small but noticeable amount of code duplication
among commands that take options like "--installed" or "--all"; it may
be worth factoring this out into a method that will return a collection
of formula objects based on the options that are passed.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd/options.rb')
| -rw-r--r-- | Library/Homebrew/cmd/options.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 454a2c7ce..e72bdb0a5 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -1,10 +1,15 @@ require 'formula' +require 'cmd/outdated' def ff if ARGV.include? "--all" Formula.all elsif ARGV.include? "--installed" - Formula.all.reject{ |f| not f.installed? } + # outdated brews count as installed + outdated = Homebrew.outdated_brews.collect{ |b| b.name } + Formula.all.select do |f| + f.installed? or outdated.include? f.name + end else ARGV.formulae end |
