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>
This commit is contained in:
parent
b62bd90a1d
commit
75a7c33e6a
@ -1,10 +1,15 @@
|
|||||||
require 'formula'
|
require 'formula'
|
||||||
|
require 'cmd/outdated'
|
||||||
|
|
||||||
def ff
|
def ff
|
||||||
if ARGV.include? "--all"
|
if ARGV.include? "--all"
|
||||||
Formula.all
|
Formula.all
|
||||||
elsif ARGV.include? "--installed"
|
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
|
else
|
||||||
ARGV.formulae
|
ARGV.formulae
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user