git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
omit source code position in regex error message
[barcat.git]
/
barcat
diff --git
a/barcat
b/barcat
index 3e1980d6aabef20521353281e5c4e0d167a34c3f..b75bf987f48ae4fe2f6de7473893ca540d074232 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-18,7
+18,10
@@
GetOptions(\%opt,
'color|c!',
'C' => sub { $opt{color} = 0 },
'field|f=s' => sub {
'color|c!',
'C' => sub { $opt{color} = 0 },
'field|f=s' => sub {
- $opt{anchor} = /^[0-9]+$/ ? qr/(?:\S*\h+){$_}\K/ : $_ for $_[1];
+ eval {
+ local $_ = $_[1];
+ $opt{anchor} = /^[0-9]+$/ ? qr/(?:\S*\h+){$_}\K/ : qr/$_/;
+ } or die $@ =~ s/(?: at .+)?$/ for option $_[0]/r;
},
'human-readable|H!',
'interval|t:i',
},
'human-readable|H!',
'interval|t:i',