grep: fix/remove references to -P

-P in gnugrepland means PCRE, which we do not support.  We may eventually
support it if onigmo ends up getting imported as a more performant regex
implementation, and we can re-add it properly in these places (and more)
when that time comes.

The optstr change is a functional nop; the case was not explicitly handled,
thus ending in usage() anyways.

Reported by:	Vladimir Misev (via twitter)
This commit is contained in:
Kyle Evans 2021-11-10 00:42:42 -06:00
parent d99b1d83b9
commit 4c14980baa
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@
.\"
.\" @(#)grep.1 8.3 (Berkeley) 4/18/94
.\"
.Dd April 17, 2021
.Dd November 10, 2021
.Dt GREP 1
.Os
.Sh NAME
@ -558,7 +558,7 @@ utility is compliant with the
specification.
.Pp
The flags
.Op Fl AaBbCDdGHhILmoPRSUVw
.Op Fl AaBbCDdGHhILmopRSUVw
are extensions to that specification, and the behaviour of the
.Fl f
flag when used with an empty pattern file is left undefined.

View File

@ -57,7 +57,7 @@ const char *errstr[] = {
"",
/* 1*/ "(standard input)",
/* 2*/ "unknown %s option",
/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C num]\n",
/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOopqRSsUVvwxz] [-A num] [-B num] [-C num]\n",
/* 4*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n",
/* 5*/ "\t[--context=num] [--directories=action] [--label] [--line-buffered]\n",
/* 6*/ "\t[--null] [pattern] [file ...]\n",
@ -110,7 +110,7 @@ bool lbflag; /* --line-buffered */
bool nullflag; /* --null */
char *label; /* --label */
const char *color; /* --color */
int grepbehave = GREP_BASIC; /* -EFGP: type of the regex */
int grepbehave = GREP_BASIC; /* -EFG: type of the regex */
int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */
int filebehave = FILE_STDIO;
int devbehave = DEV_READ; /* -D: handling of devices */
@ -152,7 +152,7 @@ usage(void)
exit(2);
}
static const char *optstr = "0123456789A:B:C:D:EFGHILOPSRUVabcd:e:f:hilm:nopqrsuvwxyz";
static const char *optstr = "0123456789A:B:C:D:EFGHILOSRUVabcd:e:f:hilm:nopqrsuvwxyz";
static const struct option long_options[] =
{