t: report missing output as TODO
[barcat.git] / barcat
diff --git a/barcat b/barcat
index cdb41dafce082c0afa399f98874f4891314c4e78..1818493a8af4603898a2e4b7f1265c6bcfda948d 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -112,7 +112,7 @@ while (readline) {
                my $trimpos = abs $opt{trim};
                $trimpos -= length $1 if $opt{unmodified};
                if ($trimpos <= 1) {
-                       $_ = substr $_, 0, 1;
+                       $_ = substr $_, 0, 2;
                }
                elsif (length > $trimpos) {
                        substr($_, $trimpos - 1) = '…';
@@ -220,10 +220,13 @@ if ($opt{stat}) {
        }
        if (@order) {
                my $total = sum @order;
-               printf '%s total', $total;
+               printf '%s total', color(1) . $total . color(0);
                printf ' in %d values', scalar @values;
-               printf ' (%s min, %*.*f avg, %s max)',
-                       $order[-1], 0, 2, $total / @order, $order[0];
+               printf(' (%s min, %s avg, %s max)',
+                       color(31) . $order[-1] . color(0),
+                       color(36) . (sprintf '%*.*f', 0, 2, $total / @order) . color(0),
+                       color(32) . $order[0] . color(0),
+               );
        }
        say '';
 }