我怎么能突出在化妆输出警告和错误行? [英] How Can I highlight the warning and error lines in the make output?

查看:101
本文介绍了我怎么能突出在化妆输出警告和错误行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对化妆凸显的产量有些麻烦。

I have some trouble about highlighting make's output.

有时候,化妆的输出是满屏幕。这是一个有点难以确定所有的警告和错误消息行。我知道也许外壳颜色输出可以提供帮助。但我已经尽力了,这是行不通的。

Sometimes, the make's output is full of the screen. It's a little bit hard to identify all the warning and error message lines. I know may shell color output can help. But I have tried, it doesn't work.

有没有人能帮助我吗?非常感谢。

Does anyone can help me? Thanks a lot.

推荐答案

有一个看看 colormake ,发现的这里

$ apt-cache search colormake
colormake - simple wrapper around make to colorize output

使用谷歌的力量,我也发现了这个bash的功能。

Using the power of google, I also found this bash-function.

make()
{
  pathpat="(/[^/]*)+:[0-9]+"
  ccred=$(echo -e "\033[0;31m")
  ccyellow=$(echo -e "\033[0;33m")
  ccend=$(echo -e "\033[0m")
  /usr/bin/make "$@" 2>&1 | sed -E -e "/[Ee]rror[: ]/ s%$pathpat%$ccred&$ccend%g" -e "/[Ww]arning[: ]/ s%$pathpat%$ccyellow&$ccend%g"
  return ${PIPESTATUS[0]}
}

这篇关于我怎么能突出在化妆输出警告和错误行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆