cli/parser: tweak formatting.

This commit is contained in:
Mike McQuaid 2020-02-01 19:03:25 +01:00
parent 0fac6e262e
commit 736dade71d
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -155,7 +155,8 @@ module Homebrew
end
def generate_help_text
@parser.to_s.sub(/^/, "#{Tty.bold}Usage: brew#{Tty.reset} ")
@parser.to_s
.sub(/^/, "#{Tty.bold}Usage: brew#{Tty.reset} ")
.gsub(/`(.*?)`/m, "#{Tty.bold}\\1#{Tty.reset}")
.gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) }
.gsub(/<(.*?)>/m, "#{Tty.underline}\\1#{Tty.reset}")