From: Mischa POSLAWSKY Date: Tue, 10 Sep 2019 22:00:41 +0000 (+0200) Subject: colored values in summary stats X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/eeebafa47ea5214696ffbe42f9970dff1be13b87?hp=bf066b0f0a9039972705713dce09c0bc5f39e29f colored values in summary stats --- diff --git a/barcat b/barcat index 4cb2cd1..1818493 100755 --- a/barcat +++ b/barcat @@ -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 ''; }