git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dff4fd8
)
silence warnings on spark
author
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 12 Mar 2021 01:06:53 +0000
(
02:06
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 17 Apr 2022 17:20:25 +0000
(19:20 +0200)
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index 879624860a84d679ba05b82a65492d4c5795a576..0fd06e240ad1a79e9adb2d31e2f405b62323b498 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-210,7
+210,7
@@
my $lenval = $opt{'value-length'} // max map { length } @order;
my $len = defined $opt{trim} && $opt{trim} <= 0 ? -$opt{trim} + 1 :
max map { length $values[$_] && length $lines[$_] }
0 .. min $#lines, $opt{hidemax} || (); # left padding
my $len = defined $opt{trim} && $opt{trim} <= 0 ? -$opt{trim} + 1 :
max map { length $values[$_] && length $lines[$_] }
0 .. min $#lines, $opt{hidemax} || (); # left padding
-my $size = $range &&
+my $size =
defined $opt{width} &&
$range &&
($opt{width} - $lenval - $len) / $range; # bar multiplication
my @barmark;
($opt{width} - $lenval - $len) / $range; # bar multiplication
my @barmark;
@@
-267,7
+267,7
@@
while ($nr <= $#lines) {
if ($opt{spark}) {
say '' if $opt{width} and $nr and $nr % $opt{width} == 0;
print color($color), $opt{spark}->[
if ($opt{spark}) {
say '' if $opt{width} and $nr and $nr % $opt{width} == 0;
print color($color), $opt{spark}->[
- !$val ? 0 : # blank
+ !$val
|| !$#{$opt{spark}}
? 0 : # blank
$val == $order[0] ? -1 : # max
$val == $order[-1] ? 1 : # min
$#{$opt{spark}} < 3 ? 1 :
$val == $order[0] ? -1 : # max
$val == $order[-1] ? 1 : # min
$#{$opt{spark}} < 3 ? 1 :