aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbsgrep12
1 files changed, 10 insertions, 2 deletions
diff --git a/bsgrep b/bsgrep
index ed57824..26f247e 100755
--- a/bsgrep
+++ b/bsgrep
@@ -29,11 +29,11 @@ $SIG{__WARN__} = sub {
};
sub grep_usage {
- print "usage: $self [--help | --version | -[iklnrsvwqz] [-d char] ...] <regex> [<file> ...]\n";
+ print "usage: $self [--help | --version | -[Fhiklnrsvwqz] [-d char] ...] <regex> [<file> ...]\n";
}
sub grep_options {
- getopts('d:hiklnqrsvwz', \%opt) || exit 1;
+ getopts('d:Fhiklnqrsvwz', \%opt) || exit 1;
if($opt{h}) {
grep_usage();
exit(0);
@@ -96,6 +96,7 @@ if($self =~ /join/) {
grep_usage();
die("$self: missing required regex argument\n");
}
+ $regex = quotemeta($regex) if $opt{F};
$regex = "(?i)$regex" if $opt{i};
}
@@ -255,6 +256,10 @@ These options are only supported by B<bsgrep>:
=over 4
+=item -F
+
+Treat pattern(s) as fixed strings, not regular expression(s). Same as B<grep>.
+
=item -i
Case-insensitive search (same as B<grep>).
@@ -355,6 +360,9 @@ B<grep>'s exit status.
=head1 LIMITATIONS
+B<bsgrep> doesn't detect binary files like B<grep> does. It can and
+will print them to your terminal instead of "binary file matches".
+
Not all b<grep> options are supported. Options that aren't implemented
but might be someday include B<--color>, B<-a>, B<-A>, B<-B>, B<-C>, B<-o>.
I don't intend to implement every single option B<grep> has, there are