This way one can run
make test > /dev/null
to suppress normal output but still see test failures, if any.
say_color()
{
+ local severity=$1
+
+ shift
if [[ "$o_nocolor" != "true" && -n "$1" ]]; then
export TERM=$ORIGINAL_TERM
- case "$1" in
+ case "$severity" in
error) tput $C_BOLD; tput $C_SETAF 1;;
skip) tput $C_SETAF 5;;
ok)
tput $C_SETAF 6;;
esac
fi
- shift
- printf "%s\n" "$*"
+ if [[ "$severity" == 'error' ]]; then
+ printf "%s\n" "$*" 1>&2
+ else
+ printf "%s\n" "$*"
+ fi
if [[ "$o_nocolor" != "true" && -n "$1" ]]; then
tput $C_SGR0
export TERM=dumb