aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2023-06-21 20:58:45 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2023-06-21 20:59:03 +0000
commit6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2 (patch)
tree63397f4046b1480d9373364e295ecd9915e522ef /usr.bin/m4
parent47b32f8f93b46ce2c7fe3973c331a40096b529da (diff)
downloadsrc-6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2.tar.gz
src-6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2.zip
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/m4.110
-rw-r--r--usr.bin/m4/main.c6
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index 838348cb78af..e234cf201213 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -41,7 +41,7 @@
.Nd macro language processor
.Sh SYNOPSIS
.Nm
-.Op Fl EgPs
+.Op Fl EGgPs
.Oo
.Sm off
.Fl D Ar name Op No = Ar value
@@ -156,8 +156,12 @@ first warning and
.Nm
will exit with a non-zero exit status.
This behaviour matches GNU-m4 1.4.9 and later.
+.It Fl G , Fl -traditional
+Disable GNU compatibility mode (see
+.Fl g
+below).
.It Fl g , Fl -gnu
-Activate GNU-m4 compatibility mode.
+Enable GNU compatibility mode.
In this mode, translit handles simple character
ranges (e.g., a-z), regular expressions mimic emacs behavior,
multiple m4wrap calls are handled as a stack,
@@ -485,7 +489,7 @@ utility is compliant with the
specification.
.Pp
The flags
-.Op Fl dEgIPot
+.Op Fl dEGgIPot
and the macros
.Ic builtin ,
.Ic esyscmd ,
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index b3cfb5b03304..f776ca8594e4 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -61,11 +61,12 @@ __FBSDID("$FreeBSD$");
#include "extern.h"
#include "pathnames.h"
-static const char *shortopts = "+D:d::EgI:o:Pst:U:";
+static const char *shortopts = "+D:d::EGgI:o:Pst:U:";
static const struct option longopts[] = {
{ "define", required_argument, NULL, 'D' },
{ "debug", optional_argument, NULL, 'd' },
{ "fatal-warnings", no_argument, NULL, 'E' },
+ { "traditional", no_argument, NULL, 'G' },
{ "gnu", no_argument, NULL, 'g' },
{ "include", required_argument, NULL, 'I' },
{ "error-output", required_argument, NULL, 'o' },
@@ -230,6 +231,9 @@ main(int argc, char *argv[])
case 'U': /* undefine... */
macro_popdef(optarg);
break;
+ case 'G':
+ mimic_gnu = 0;
+ break;
case 'g':
mimic_gnu = 1;
break;