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:
a417d6d
)
compile regular expression to -f (without /x)
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Sep 2019 14:39:29 +0000
(16:39 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Sep 2019 18:16:38 +0000
(20:16 +0200)
Reports syntax errors immediately.
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index 3e1980d6aabef20521353281e5c4e0d167a34c3f..6d5610996a00f7b7c614d67a26956ac162fe2ff4 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-18,7
+18,10
@@
GetOptions(\%opt,
'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 "$@ for option $_[0]\n";
},
'human-readable|H!',
'interval|t:i',