info: print requirements
This commit is contained in:
parent
8e9a9b6428
commit
245838d86d
@ -45,7 +45,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
ARGV.named.each_with_index do |f, i|
|
ARGV.named.each_with_index do |f, i|
|
||||||
puts unless i.zero?
|
puts unless i == 0
|
||||||
begin
|
begin
|
||||||
if f.include?("/") || File.exist?(f)
|
if f.include?("/") || File.exist?(f)
|
||||||
info_formula Formulary.factory(f)
|
info_formula Formulary.factory(f)
|
||||||
@ -146,6 +146,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless f.requirements.to_a.empty?
|
||||||
|
ohai "Requirements"
|
||||||
|
%w[build required recommended optional].map do |type|
|
||||||
|
reqs = f.requirements.select(&:"#{type}?")
|
||||||
|
puts "#{type.capitalize}: #{decorate_requirements(reqs)}" unless reqs.to_a.empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
unless f.options.empty?
|
unless f.options.empty?
|
||||||
ohai "Options"
|
ohai "Options"
|
||||||
Homebrew.dump_options_for_formula f
|
Homebrew.dump_options_for_formula f
|
||||||
@ -161,4 +169,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
deps_status * ", "
|
deps_status * ", "
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def decorate_requirements(requirements)
|
||||||
|
req_status = requirements.collect do |req|
|
||||||
|
req.satisfied? ? pretty_installed(req.name) : pretty_uninstalled(req.name)
|
||||||
|
end
|
||||||
|
req_status * ", "
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user