diff options
| author | Mike McQuaid | 2016-09-27 09:48:14 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-27 09:48:14 +0100 |
| commit | b432f8e9cb2d03c8f1d7a65b9d6df2e04b3d37a7 (patch) | |
| tree | b65ae52cf67eda6b4bc39d38377e86b2b4f576b3 /Library/Homebrew/cmd | |
| parent | 92e6edea539d2b9e79ce3854522b9cfc6ceca06c (diff) | |
| parent | 5aaccba34cef9a1766f8f944c276e76569cf9907 (diff) | |
| download | brew-b432f8e9cb2d03c8f1d7a65b9d6df2e04b3d37a7.tar.bz2 | |
Merge pull request #1004 from apjanke/print-requirements
info: print requirements
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 09c832203..6f242039c 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -143,6 +143,15 @@ 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}?") + next if reqs.to_a.empty? + puts "#{type.capitalize}: #{decorate_requirements(reqs)}" + end + end + unless f.options.empty? ohai "Options" Homebrew.dump_options_for_formula f @@ -158,4 +167,12 @@ module Homebrew end deps_status * ", " end + + def decorate_requirements(requirements) + req_status = requirements.collect do |req| + req_s = req.display_s + req.satisfied? ? pretty_installed(req_s) : pretty_uninstalled(req_s) + end + req_status.join(", ") + end end |
