2 # (C) 2016, "Yann E. MORIN" <yann.morin.1998@free.fr>
3 # License: WTFPL, https://spdx.org/licenses/WTFPL.html
6 local found ret start d h m mf
8 if ! which unbuffer >/dev/null 2>&1; then
9 printf "you need to install 'unbuffer' (from package expect or expect-dev)\n" >&2
15 ( exec 2>&1; unbuffer make "${@}"; ) \
16 > >( while read line; do
17 printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}"
20 |grep --colour=never -E '>>>'
28 [ ${h} -eq 0 ] || { printf "%dh " ${h}; mf="02"; }
31 [ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; }
32 printf "%${sf}ds" ${d}
34 if [ ${ret} -ne 0 ]; then
35 printf " (error code: %s)" ${ret}