brew/Library/Homebrew/cmd/missing.rb

33 lines
759 B
Ruby
Raw Normal View History

2016-10-10 13:41:27 +01:00
#: * `missing` [`--hide=`<hidden>] [<formulae>]:
#: Check the given <formulae> for missing dependencies. If no <formulae> are
#: given, check all installed brews.
2016-10-10 13:41:27 +01:00
#:
#: If `--hide=`<hidden> is passed, act as if none of <hidden> are installed.
2016-10-30 16:30:40 +00:00
#: <hidden> should be a comma-separated list of formulae.
2016-04-08 16:28:43 +02:00
require "formula"
require "tab"
require "diagnostic"
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
def missing
return unless HOMEBREW_CELLAR.exist?
ff = if ARGV.named.empty?
Formula.installed
else
2015-05-17 21:02:54 +08:00
ARGV.resolved_formulae
end
ff.each do |f|
2016-10-10 13:26:09 +01:00
missing = f.missing_dependencies(hide: ARGV.values("hide"))
next if missing.empty?
print "#{f}: " if ff.size > 1
puts missing.join(" ")
end
end
end