aboutsummaryrefslogtreecommitdiff
path: root/bsgrep
diff options
context:
space:
mode:
Diffstat (limited to 'bsgrep')
-rwxr-xr-xbsgrep77
1 files changed, 71 insertions, 6 deletions
diff --git a/bsgrep b/bsgrep
index 211a6f9..19ca3aa 100755
--- a/bsgrep
+++ b/bsgrep
@@ -22,7 +22,7 @@ $SIG{__WARN__} = sub {
# from the 'while(<>)' or File::Find.
if($m !~ /^$self:/) {
$m = "$self: $m";
- $ret = 2 unless $opt{s};
+ $ret = 2 unless $opt{q};
}
print STDERR $m unless $opt{s};
@@ -315,22 +315,29 @@ select lines that match all of the patterns; the default is to select
lines that match any of the patterns. This option doesn't exist
in B<grep>.
+=item -q
+
+Quiet: don't write to standard output. Exit status will be zero if
+a match was found, even if there were errors. This doesn't prevent
+warnings/errors being printed to standard error; use B<-s> to silence
+those. Same as B<grep>.
+
=item -r
Recursively read all files under each directory, following symlinks
only if they're on the command line. If no files or directories are
given, reads the current directory. Same as B<grep>.
-=item -v
-
-Print only lines that do I<not> match (same as B<grep>).
-
=item -s
Silence warnings (same as B<grep>). This includes error messages
about unreadable files as well as warnings about the input (see
B<DIAGNOSTICS>, below).
+=item -v
+
+Print only lines that do I<not> match (same as B<grep>).
+
=back
=head1 EXAMPLE
@@ -409,7 +416,7 @@ to be Unicode, it will be assumed ISO-8859-1, and converted to Unicode.
=head1 EXIT STATUS
0 if there were any matches, 1 if there were none, or 2 if there
-were errors (e.g. nonexistent file). However, with B<-s>, the exit
+were errors (e.g. nonexistent file). However, with B<-q>, the exit
status will be 0 or 1 even if there were errors. This is the same as
B<grep>'s exit status.
@@ -445,3 +452,61 @@ under the WTFPL: Do WTF you want with this.
B<grep>(1), B<perl>(1)
=cut
+
+__END__
+
+implemented:
+ --help
+ -V, --version
+ -F, --fixed-strings
+ -e PATTERNS, --regexp=PATTERNS
+ -i, --ignore-case
+ -v, --invert-match
+ -q, --quiet, --silent
+ -s, --no-messages
+ -n, --line-number
+ -z, --null-data
+ -r, --recursive
+ -l, --files-with-matches
+
+todo:
+ -f FILE, --file=FILE
+ -y Obsolete synonym for -i.
+ -c, --count
+ -R, --dereference-recursive
+ -L, --files-without-match
+ -Z, --null
+ -A NUM, --after-context=NUM
+ -B NUM, --before-context=NUM
+ -C NUM, -NUM, --context=NUM
+ -H, --with-filename
+ -h, --no-filename
+ -w, --word-regexp
+ -x, --line-regexp
+
+do not implement:
+ -E, --extended-regexp
+ -G, --basic-regexp
+ -P, --perl-regexp
+ --no-ignore-case
+
+undecided:
+ --color[=WHEN], --colour[=WHEN]
+ -m NUM, --max-count=NUM
+ -o, --only-matching
+ -b, --byte-offset
+ --label=LABEL
+ -T, --initial-tab
+ --group-separator=SEP
+ --no-group-separator
+ -a, --text
+ --binary-files=TYPE
+ -D ACTION, --devices=ACTION
+ -d ACTION, --directories=ACTION
+ --exclude=GLOB
+ --exclude-from=FILE
+ --exclude-dir=GLOB
+ -I
+ --include=GLOB
+ --line-buffered
+ -U, --binary