aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/help.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-17 03:21:51 +0200
committerMarkus Reiter2016-10-01 20:00:49 +0200
commit884b26850615d5624e09762e1ae8bc5b104a934a (patch)
tree310fc74849e3b15b940bd7f57b67c323120a771a /Library/Homebrew/cmd/help.rb
parent75e8b59aad4814112a53119f68ed629d60b3f97b (diff)
downloadbrew-884b26850615d5624e09762e1ae8bc5b104a934a.tar.bz2
Use Formatter for all URLs.
Diffstat (limited to 'Library/Homebrew/cmd/help.rb')
-rw-r--r--Library/Homebrew/cmd/help.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb
index 05a3003cc..c8845b086 100644
--- a/Library/Homebrew/cmd/help.rb
+++ b/Library/Homebrew/cmd/help.rb
@@ -78,11 +78,12 @@ module Homebrew
HOMEBREW_HELP
else
help_lines.map do |line|
- line.slice(2..-1).
- sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ").
- gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}").
- gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}").
- gsub("@hide_from_man_page", "")
+ line.slice(2..-1)
+ .sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ")
+ .gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}")
+ .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) }
+ .gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}")
+ .gsub("@hide_from_man_page", "")
end.join.strip
end
end