From a279033b56c8f8a25da16c7b57c38cfa01452dbf Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 19 Sep 2019 14:38:03 +0200 Subject: [PATCH] colored header like values --- barcat | 8 +++++++- t/t1901-technicolor_-cs_--header.out | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/barcat b/barcat index 268c993..4f72356 100755 --- a/barcat +++ b/barcat @@ -193,7 +193,13 @@ sub sival { ); } -say sprintf '%*s-+%*s-+', $lenval, $minval, $size * ($maxval - $minval) - 3, $maxval if $opt{header}; +say( + color(31), sprintf('%*s', $lenval, $minval), + color(90), '-', color(36), '+', + color(32), sprintf('%*s', $size * ($maxval - $minval) - 3, $maxval), + color(90), '-', color(36), '+', + color(0), +) if $opt{header}; while ($nr <= $#lines) { $nr >= $opt{hidemax} and last if defined $opt{hidemax}; diff --git a/t/t1901-technicolor_-cs_--header.out b/t/t1901-technicolor_-cs_--header.out index e1d4a41..a08916e 100644 --- a/t/t1901-technicolor_-cs_--header.out +++ b/t/t1901-technicolor_-cs_--header.out @@ -1,4 +1,4 @@ - -3-+ 2-+ + -3-+ 2-+  -3  -2.449 --  -2 ---- -- 2.30.0