]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
Align wvtest results
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 8 Feb 2011 08:42:03 +0000 (09:42 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 8 Feb 2011 08:42:03 +0000 (09:42 +0100)
Now, the results of wvtest output is aligned to the 10 right characters
of the terminal.

src/wvtest/wvtestrun

index f4ce482d7ad928ca8046ff682a0d6f3ca54dac98..c7138ed571437d5c54bf9e1467ce276e2cd55a28 100755 (executable)
@@ -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;
     }