git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
colored header like values
[barcat.git]
/
barcat
diff --git
a/barcat
b/barcat
index a7c67ee11cb88a543c502da66036f4f7d1bf823f..4f723569c04f91d581cd2dc26e0e69820e7aac38 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-6,7
+6,7
@@
use List::Util qw( min max sum );
use open qw( :std :utf8 );
use experimental qw( lexical_subs );
use open qw( :std :utf8 );
use experimental qw( lexical_subs );
-our $VERSION = '1.0
5
';
+our $VERSION = '1.0
6
';
use Getopt::Long '2.33', qw( :config gnu_getopt );
my %opt;
use Getopt::Long '2.33', qw( :config gnu_getopt );
my %opt;
@@
-42,6
+42,7
@@
GetOptions(\%opt,
" (range expected)\n"
);
},
" (range expected)\n"
);
},
+ 'header!',
'markers|m=s',
'graph-format=s' => sub {
$opt{'graph-format'} = substr $_[1], 0, 1;
'markers|m=s',
'graph-format=s' => sub {
$opt{'graph-format'} = substr $_[1], 0, 1;
@@
-53,6
+54,10
@@
GetOptions(\%opt,
'signal-stat=s',
'unmodified|u!',
'width|w=i',
'signal-stat=s',
'unmodified|u!',
'width|w=i',
+ 'version' => sub {
+ say "barcat version $VERSION";
+ exit;
+ },
'usage|h' => sub {
local $/;
my $pod = readline *DATA;
'usage|h' => sub {
local $/;
my $pod = readline *DATA;
@@
-188,6
+193,14
@@
sub sival {
);
}
);
}
+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};
my $val = $values[$nr];
while ($nr <= $#lines) {
$nr >= $opt{hidemax} and last if defined $opt{hidemax};
my $val = $values[$nr];
@@
-290,6
+303,10
@@
A string can indicate the starting position of a value
or capture the numbers itself,
for example I<-f'(\d+)'> for the first digits anywhere.
or capture the numbers itself,
for example I<-f'(\d+)'> for the first digits anywhere.
+=item --header
+
+Prepend a chart axis with minimum and maximum values labeled.
+
=item -H, --human-readable
Format values using SI unit prefixes,
=item -H, --human-readable
Format values using SI unit prefixes,
@@
-356,10
+373,17
@@
or 68% of all entries.
=back
=back
-=item --spark
+=item --spark
[=<glyphs>]
Replace lines by I<sparklines>,
single characters corresponding to input values.
Replace lines by I<sparklines>,
single characters corresponding to input values.
+A specified sequence of unicode characters will be used for
+Of a specified sequence of unicode characters,
+the first one will be used for non-values,
+the last one for the maximum,
+the second (if any) for the minimum,
+and any remaining will be distributed over the range of values.
+Unspecified, block fill glyphs U+2581-2588 will be used.
=item -s, --stat
=item -s, --stat