X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/f4423db9671d9650e7a39482ffc935d373e72ef5..cf2b124da358c7fb2e00c7b8e814b6b78bdfe004:/barcat diff --git a/barcat b/barcat index 82cf7d6..a4ed12f 100755 --- a/barcat +++ b/barcat @@ -1,4 +1,4 @@ -#!/usr/bin/env perl +#!/usr/bin/perl -CA use 5.018; use warnings; use utf8; @@ -47,8 +47,8 @@ GetOptions(\%opt, ); }, 'markers|m=s', - 'spark!' => sub { - $opt{spark} = [split //, '⎽▁▂▃▄▅▆▇█']; + 'spark:s' => sub { + $opt{spark} = [split //, $_[1] || '⎽▁▂▃▄▅▆▇█']; }, 'stat|s!', 'unmodified|u!', @@ -63,6 +63,7 @@ $opt{trim} *= $opt{width} / 100 if $opt{trimpct}; $opt{units} = [split //, ' kMGTPEZYyzafpnμm'] if $opt{'human-readable'}; $opt{anchor} //= qr/\A/; $opt{'value-length'} = 6 if $opt{units}; +$opt{'value-length'} = 1 if $opt{unmodified}; my (@lines, @values, @order); @@ -93,6 +94,7 @@ while (readline) { push @order, $1 if length $1; if (defined $opt{trim} and defined $1) { my $trimpos = abs $opt{trim}; + $trimpos -= length $1 if $opt{unmodified}; if ($trimpos <= 1) { $_ = substr $_, 0, 1; } @@ -315,7 +317,7 @@ Total statistics after all data. =item -u, --unmodified -Do not strip leading whitespace. +Do not reformat values, keeping leading whitespace. Keep original value alignment, which may be significant in some programs. =item --value-length=