info: Print reason for conflicts where available

This commit is contained in:
John Hawkinson 2017-04-09 15:23:53 -04:00
parent 31ce953f69
commit 971e53c001

View File

@ -123,8 +123,12 @@ module Homebrew
puts f.desc if f.desc
puts Formatter.url(f.homepage) if f.homepage
conflicts = f.conflicts.map(&:name).sort!
puts "Conflicts with: #{conflicts*", "}" unless conflicts.empty?
conflicts = f.conflicts.map{ |f|
f.name +
if f.reason then " (because #{f.reason})" else "" end
}.sort!
msg="Conflicts with: "
puts msg+conflicts*(",\n"+" "*msg.length) unless conflicts.empty?
kegs = f.installed_kegs.sort_by(&:version)
if kegs.empty?