aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAndrew Janke2016-09-18 00:12:49 -0400
committerAndrew Janke2016-09-18 19:44:41 -0400
commit245838d86d21250feeabc44dbc6ffabfed653df5 (patch)
treef86fe05ef8ac7693be66f96a5bc798f8bb7f1e49 /Library
parent8e9a9b6428e5d6fea6d9808ab2c6101f598e0eb7 (diff)
downloadbrew-245838d86d21250feeabc44dbc6ffabfed653df5.tar.bz2
info: print requirements
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/info.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index 0310ab624..04719347f 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -45,7 +45,7 @@ module Homebrew
end
else
ARGV.named.each_with_index do |f, i|
- puts unless i.zero?
+ puts unless i == 0
begin
if f.include?("/") || File.exist?(f)
info_formula Formulary.factory(f)
@@ -146,6 +146,14 @@ module Homebrew
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?
ohai "Options"
Homebrew.dump_options_for_formula f
@@ -161,4 +169,11 @@ module Homebrew
end
deps_status * ", "
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