aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/info.rb
diff options
context:
space:
mode:
authorXu Cheng2015-11-16 20:10:25 +0800
committerXu Cheng2015-11-16 20:59:13 +0800
commit14fbc8c39e339bbcd2927bc18219c52fbb1898ff (patch)
tree529617dca067a5479aaf426d6d4755da389063dd /Library/Homebrew/cmd/info.rb
parent02d7abe2ec9491c6c56b6f59749d5ff911ba69ed (diff)
downloadbrew-14fbc8c39e339bbcd2927bc18219c52fbb1898ff.tar.bz2
improve brew info
* Show pinned and keg-only as attributes, where pinned version is shown as well. * Use brackets instead of parentheses to distinguish formula attributes(e.g. keg-only) with spec attributes(e.g. bottled) * Don't show blank line for formula without homepage. * Don't show duplicated keg-only message which will be shown later in caveats. * Underline urls. * Remove unnecessary github_info return value check, which is always existed. Closes Homebrew/homebrew#46037. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/cmd/info.rb')
-rw-r--r--Library/Homebrew/cmd/info.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index 52d39ca15..70c1a2c9e 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -105,18 +105,13 @@ module Homebrew
specs << "HEAD" if f.head
- puts "#{f.full_name}: #{specs*", "}#{" (pinned)" if f.pinned?}"
+ attrs = []
+ attrs << "pinned at #{f.pinned_version}" if f.pinned?
+ attrs << "keg-only" if f.keg_only?
+ puts "#{f.full_name}: #{specs * ", "}#{" [#{attrs * ", "}]" if attrs.any?}"
puts f.desc if f.desc
-
- puts f.homepage
-
- if f.keg_only?
- puts
- puts "This formula is keg-only."
- puts f.keg_only_reason
- puts
- end
+ puts "#{Tty.em}#{f.homepage}#{Tty.reset}" if f.homepage
conflicts = f.conflicts.map(&:name).sort!
puts "Conflicts with: #{conflicts*", "}" unless conflicts.empty?
@@ -132,8 +127,7 @@ module Homebrew
puts "Not installed"
end
- history = github_info(f)
- puts "From: #{history}" if history
+ puts "From: #{Tty.em}#{github_info(f)}#{Tty.reset}"
unless f.deps.empty?
ohai "Dependencies"