help: support highlighted output
Closes #68. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
af1eb007e2
commit
c1427fd295
@ -56,7 +56,10 @@ module Homebrew
|
|||||||
cmd_path.read.
|
cmd_path.read.
|
||||||
split("\n").
|
split("\n").
|
||||||
grep(/^#:/).
|
grep(/^#:/).
|
||||||
map { |line| line.slice(2..-1).delete("`").sub(/^ \* /, "brew ") }.
|
map do |line|
|
||||||
join("\n")
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user