git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test inputless command behaviour
[barcat.git]
/
barcat
diff --git
a/barcat
b/barcat
index 442559c804a05ac433f2e473c48cc4c19b3e2d37..978a222aeac342f6d560e0a0ab405a3ed6b9c77f 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
4
';
+our $VERSION = '1.0
5
';
use Getopt::Long '2.33', qw( :config gnu_getopt );
sub podexit {
use Getopt::Long '2.33', qw( :config gnu_getopt );
sub podexit {
@@
-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{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);
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};
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;
}
if ($trimpos <= 1) {
$_ = substr $_, 0, 1;
}
@@
-315,7
+317,7
@@
Total statistics after all data.
=item -u, --unmodified
=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=<size>
Keep original value alignment, which may be significant in some programs.
=item --value-length=<size>