Fix empty stats again, with tests for probable future breakage.
defined && do {
$_ = $opt{'value-format'}->($_) if $format;
if ($cmd and $op eq ':') {
defined && do {
$_ = $opt{'value-format'}->($_) if $format;
if ($cmd and $op eq ':') {
- $_ = varfmt($cmd, $vars);
+ $_ = !!$_ && varfmt($cmd, $vars);
}
elsif ($cmd) {
eval $cmd;
}
elsif ($cmd) {
eval $cmd;
--- /dev/null
+barcat -s input/empty_input.txt
+0 values
-barcat -sL0 input/seq3.txt
+barcat -s input/seq3.txt | tail -n1
6 total in 3 values (1 min, 2.00 avg, 3 max)
6 total in 3 values (1 min, 2.00 avg, 3 max)
--- /dev/null
+echo | barcat -s
+
+0 values over 1 lines