Skip to content
Snippets Groups Projects
Commit c1427fd2 authored by Xu Cheng's avatar Xu Cheng
Browse files

help: support highlighted output


Closes #68.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent af1eb007
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,10 @@ module Homebrew
cmd_path.read.
split("\n").
grep(/^#:/).
map { |line| line.slice(2..-1).delete("`").sub(/^ \* /, "brew ") }.
join("\n")
map do |line|
line.slice(2..-1).sub(/^ \* /, "#{Tty.highlight}brew#{Tty.reset} ").
gsub(/`(.*?)`/, "#{Tty.highlight}\\1#{Tty.reset}").
gsub(/<(.*?)>/, "#{Tty.em}\\1#{Tty.reset}")
end.join("\n")
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment