git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3de553c
)
shorthand -f+ for first number (+0)
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 20 Nov 2022 17:50:45 +0000
(18:50 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 21 Nov 2022 15:24:42 +0000
(16:24 +0100)
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index 5181143fe9bdd92d1544dc49b69f07e52ddaa754..d8deee4b6834d3893ce71e706feba5e2f522d449 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-20,7
+20,9
@@
GetOptions(\%opt,
eval {
local $_ = $_[1];
s/\A[0-9]+\z/(?:\\S*\\h+){$_}\\K/;
eval {
local $_ = $_[1];
s/\A[0-9]+\z/(?:\\S*\\h+){$_}\\K/;
- s/\A[+]([0-9]*)\z/(?:\\d+\\D+\\b){$1}\\K \\s* (?=\\d)/;
+ s{\A[+]([0-9]*)\z}{
+ (!!$1 && '(?:\d+\D+\b){'.$1.'}\K') . '\s* (?=\d)'
+ }e;
$opt{anchor} = qr/$_/;
} or die $@ =~ s/(?:\ at\ \N+)?\Z/ for option $_[0]/r;
},
$opt{anchor} = qr/$_/;
} or die $@ =~ s/(?:\ at\ \N+)?\Z/ for option $_[0]/r;
},
@@
-605,7
+607,7
@@
Compare file sizes (with human-readable numbers):
Same from formatted results, selecting the first numeric value:
Same from formatted results, selecting the first numeric value:
- tree -s --noreport | barcat -H -f+
0
+ tree -s --noreport | barcat -H -f+
Memory usage of user processes with long names truncated:
Memory usage of user processes with long names truncated: