Gcc
From Attie's Wiki
Highlight the output of gcc
- warnings will be highlighted yellow
- errors will be highlighted red
stdbuf -oL make 2>&1 | \ sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' \ -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'
Or try this one, to dim everything that isn't interesting, and highlight TODO
's:
stdbuf -oL make "$@" 2>&1 | \ sed -ure 's/^[^:]+:[0-9]+:[0-9]+: warning: .+$/\x1B[38;5;208m&\x1B[m/g' \ -e 's/^[^:]+:[0-9]+:[0-9]+: error: .+$/\x1B[38;5;161m&\x1B[m/g' \ -e 's/^[^:]+:[0-9]+:[0-9]+: note: .+$/\x1B[38;5;94m&\x1B[m/g' \ -e 's/^[^:]+: In function .+$/\x1B[38;5;34m&\x1B[m/g' \ -e 's/^(\x1B\[38;5;208m.*)(TODO)(.*)$/\1\x1B[38;5;33m\2\x1B[38;5;208m\3/g' \ -e 's/^(make\[[0-9]*\]: (Entering|Leaving) directory )(`.*)$/\x1B[38;5;90m\1\x1B[38;5;200m\3\x1B[m/g' \ -e 's/^[^\x1B].+$/\x1B[90m&\x1B[m/g'
script form
Or, put this in your path, called mk
or something:
#!/bin/bash stdbuf -oL make "$@" 2>&1 | \ sed -ure 's/^[^:]+:[0-9]+:[0-9]+: warning: .+$/\x1B[38;5;208m&\x1B[m/g' \ -e 's/^[^:]+:[0-9]+:[0-9]+: error: .+$/\x1B[38;5;161m&\x1B[m/g' \ -e 's/^[^:]+:[0-9]+:[0-9]+: note: .+$/\x1B[38;5;94m&\x1B[m/g' \ -e 's/^[^:]+: In function .+$/\x1B[38;5;34m&\x1B[m/g' \ -e 's/^(\x1B\[38;5;208m.*)(TODO)(.*)$/\1\x1B[38;5;33m\2\x1B[38;5;208m\3/g' \ -e 's/^(make\[[0-9]*\]: (Entering|Leaving) directory )(`.*)$/\x1B[38;5;90m\1\x1B[38;5;200m\3\x1B[m/g' \ -e 's/^[^\x1B].+$/\x1B[90m&\x1B[m/g' exit $?