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) = '…';
}
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 '';
}
Contents are concatenated similar to I<cat>,
but numbers are reformatted and a bar graph is appended to each line.
+Don't worry, barcat does not drink and divide.
+It can has various options for input and output (re)formatting,
+but remains limited to one-dimensional charts.
+For more complex graphing needs
+you'll need a larger animal like I<gnuplot>.
+
=head1 OPTIONS
=over
Override the maximum number of columns to use.
Appended graphics will extend to fill up the entire screen.
+=item -h, --usage
+
+Overview of available options.
+
+=item --help
+
+Full documentation
+rendered by perldoc.
+
+=item --version
+
+Version information.
+
=back
=head1 EXAMPLES