Skip to content

Commit 667658c

Browse files
authored
grep: documentation update
* In pod SYNOPSIS, -i was listed twice and -Z wasn't listed * Usage string was missing -Z too * Sort single letter options, including getopts() call; this makes it easier to see what is happening * No intended functional change
1 parent 51ac8d3 commit 667658c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

bin/grep

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,35 @@ sub VERSION_MESSAGE {
9292

9393
sub usage {
9494
die <<EOF;
95-
usage: $Me [-IincwsxvHhLlFguRraqT] [-e pattern] [-A NUM] [-B NUM] [-C NUM]
95+
usage: $Me [-acFgHhIiLlnqRrsTuvwxZ] [-e pattern] [-A NUM] [-B NUM] [-C NUM]
9696
[-m NUM] [-f pattern-file] [pattern] [file...]
9797
9898
Options:
99-
-i case insensitive
100-
-n number lines
99+
-A show lines after each matching line
100+
-a treat binary files as plain text files
101+
-B show lines before each matching line
102+
-C show lines of context around each matching line
101103
-c give count of lines matching
102-
-w word boundaries only
103-
-q quiet; nothing is written to standard output
104-
-x exact matches only
105-
-v invert search sense (lines that DON'T match)
106-
-H show filenames
107-
-h hide filenames
108104
-e expression (for exprs beginning with -)
105+
-F search for fixed strings (disable regular expressions)
109106
-f file with expressions
110-
-l list filenames matching
107+
-g highlight matches
108+
-H show filenames
109+
-h hide filenames
110+
-I ignore binary files
111+
-i case insensitive
111112
-L list filenames which do not match
112-
-F search for fixed strings (disable regular expressions)
113+
-l list filenames matching
113114
-m limit total matches per file
114-
-g highlight matches
115-
-u underline matches
115+
-n number lines
116+
-q quiet; nothing is written to standard output
116117
-r recursive on directories or dot if none
117-
-C show lines of context around each matching line
118-
-B show lines before each matching line
119-
-A show lines after each matching line
120-
-a treat binary files as plain text files
121-
-I ignore binary files
122118
-s suppress errors for failed file and dir opens
123119
-T trace files as opened
120+
-u underline matches
121+
-v invert search sense (lines that DON'T match)
122+
-w word boundaries only
123+
-x exact matches only
124124
-Z force grep to behave as zgrep
125125
EOF
126126
}
@@ -241,7 +241,7 @@ sub parse_args {
241241
}
242242
@ARGV = @tmparg;
243243

244-
getopts('IinC:cwsxvHhLlguRraqTFZm:A:B:', \%opt) or usage();
244+
getopts('A:aB:C:cFgHhIiLlm:nqRrsTuvwxZ', \%opt) or usage();
245245

246246
$opt{'r'} ||= $opt{'R'};
247247
if (defined $opt{'m'} && $opt{'m'} !~ m/\A[0-9]+\z/) {
@@ -546,7 +546,7 @@ grep - search for regular expressions and print
546546
547547
=head1 SYNOPSIS
548548
549-
grep [-IincwsxvhHlLFiguRraqT] [-e pattern] [-A NUM] [-B NUM] [-C NUM]
549+
grep [-acFgHhIiLlnqRrsTuvwxZ] [-e pattern] [-A NUM] [-B NUM] [-C NUM]
550550
[-m NUM] [-f pattern-file] [pattern] [file ...]
551551
552552
=head1 DESCRIPTION

0 commit comments

Comments
 (0)