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 (from parent 1:
fcca011
)
combined limit minimum-maximum
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Sep 2019 03:14:43 +0000
(
05:14
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Sep 2019 18:16:38 +0000
(20:16 +0200)
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index c4244d4e61d5e99d4c80d6432387782f27d4296d..a69bbe520e735ba27a8736b6939891994208badb 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-30,8
+30,15
@@
GetOptions(\%opt,
},
'value-length=i',
'hidemin=i',
},
'value-length=i',
'hidemin=i',
- 'hidemax|limit|L=i' => sub {
- $opt{$_[1] < 0 ? 'hidemin' : 'hidemax'} = abs $_[1];
+ 'hidemax=i',
+ 'limit|L=s' => sub {
+ my ($optname, $optval) = @_;
+ $optval ||= 0;
+ ($opt{hidemin}, $opt{hidemax}) =
+ $optval =~ m/\A (?: ([0-9]+)? - )? ([0-9]+)? \z/x or die(
+ "Value \"$optval\" invalid for option limit",
+ " (range expected)\n"
+ );
},
'markers|m=s',
'unmodified|u!',
},
'markers|m=s',
'unmodified|u!',
@@
-190,7
+197,7
@@
unless C<--length=0>.
Prepend a dash (i.e. make negative) to enforce padding
regardless of encountered contents.
Prepend a dash (i.e. make negative) to enforce padding
regardless of encountered contents.
-=item -L, --limit=
[-]<count>
+=item -L, --limit=
(<count>|<start>-[<end>])
Stop output after a number of lines.
All input is still counted and analyzed for statistics,
Stop output after a number of lines.
All input is still counted and analyzed for statistics,