From: Mischa POSLAWSKY Date: Sat, 5 Feb 2011 02:16:24 +0000 (+0100) Subject: grep option X-Git-Url: http://git.shiar.net/git-grep-footer.git/commitdiff_plain/d1939a281787a94f5694cdb119baabdf2889ac3f grep option --- diff --git a/git-grep-footer b/git-grep-footer index b676ab8..c5d9440 100755 --- a/git-grep-footer +++ b/git-grep-footer @@ -13,6 +13,7 @@ GetOptions(\my %opt, 'simplify|s:s', 'ignore-case|i!', 'fuzzy!', + 'grep|S=s', 'min|min-count|unique|u:i', 'max|max-count|show|n:i', 'version|V' => sub { Getopt::Long::VersionMessage() }, @@ -75,6 +76,10 @@ while (readline) { } } + if (defined $opt{grep}) { + $_ ~~ qr/$opt{grep}/i or next LINE; + } + given ($opt{simplify} // 'none') { when (['email', 'authors']) { $header[1] =~ s{ @@ -200,6 +205,11 @@ Values will be hidden entirely, so only attribute names remain. =back +=item --grep= + +Only include lines matching the specified regular expression. +Case insensitivity can be disabled by prepending C<(?-i)>. + =item -u, --unique[=] Each match is only shown once,