From 701d73b65cebed4b5de2d35b70d4e5061f6b1ccb Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 31 Mar 2010 17:40:13 +0000 Subject: [PATCH] Make -r mean exactly the same thing as -E for increased compatibility with GNU sed. MFC after: 7 days --- usr.bin/sed/main.c | 3 ++- usr.bin/sed/sed.1 | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index 1a140b144142..8d4fe95a33d8 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -130,8 +130,9 @@ main(int argc, char *argv[]) fflag = 0; inplace = NULL; - while ((c = getopt(argc, argv, "EI:ae:f:i:ln")) != -1) + while ((c = getopt(argc, argv, "EI:ae:f:i:lnr")) != -1) switch (c) { + case 'r': /* Gnu sed compat */ case 'E': rflags = REG_EXTENDED; break; diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index d5858ffc82f1..0744630b57a3 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -39,11 +39,11 @@ .Nd stream editor .Sh SYNOPSIS .Nm -.Op Fl Ealn +.Op Fl Ealnr .Ar command .Op Ar .Nm -.Op Fl Ealn +.Op Fl Ealnr .Op Fl e Ar command .Op Fl f Ar command_file .Op Fl I Ar extension @@ -144,6 +144,10 @@ all of the commands have been applied to it. The .Fl n option suppresses this behavior. +.It Fl r +Same as +.Fl E +for compatibility with GNU sed. .El .Pp The form of a