From: Michal Sojka Date: Tue, 8 Feb 2011 08:42:03 +0000 (+0100) Subject: Align wvtest results X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-forb.git/commitdiff_plain/2116ba8fbc7e9fe02d806c8b0b2e767357ea97f0 Align wvtest results Now, the results of wvtest output is aligned to the 10 right characters of the terminal. --- diff --git a/src/wvtest/wvtestrun b/src/wvtest/wvtestrun index f4ce482d..c7138ed5 100755 --- a/src/wvtest/wvtestrun +++ b/src/wvtest/wvtestrun @@ -63,6 +63,8 @@ local $SIG{ALRM} = sub { bigkill($pid); }; +my $column = `tput cols` - 10; + sub colourize($) { my $result = shift; @@ -70,7 +72,8 @@ sub colourize($) if ($istty) { my $colour = $pass ? "\e[32;1m" : "\e[31;1m"; - return "$colour$result\e[0m"; + my $column = "\e[${column}G"; + return "$column$colour$result\e[0m"; } else { return $result; }