Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jul 2021 05:43:18 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4e52f5db352f - main - awk: Flag -Ft as deprecated behavior
Message-ID:  <202107310543.16V5hIUF079261@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e52f5db352fe54d6ba342bcde01228096db8b19

commit 4e52f5db352fe54d6ba342bcde01228096db8b19
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-07-31 05:19:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-31 05:33:37 +0000

    awk: Flag -Ft as deprecated behavior
    
    Upstream is poised to deprecate the -Ft wart in one true awk. None of
    the other awks do this, and the gawk maintainer says that he's had no
    requests for it in gawk in 30 years maintaining it. github can find a
    few instances of it in the wild. As such, warn that it's deprecated and
    will go away in the future.
    
    MFC After:              3 days
    Sponsored by:           Netflix
---
 contrib/one-true-awk/main.c |  4 +++-
 usr.bin/awk/awk.1           | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c
index 4e68bfb46d27..35d0ca7d098f 100644
--- a/contrib/one-true-awk/main.c
+++ b/contrib/one-true-awk/main.c
@@ -89,8 +89,10 @@ static const char *
 setfs(char *p)
 {
 	/* wart: t=>\t */
-	if (p[0] == 't' && p[1] == '\0')
+	if (p[0] == 't' && p[1] == '\0') {
+		WARNING("-Ft to imply tab separator is deprecated behavior.");
 		return "\t";
+	}
 	return p;
 }
 
diff --git a/usr.bin/awk/awk.1 b/usr.bin/awk/awk.1
index b85efe9d87cd..20bb510a1516 100644
--- a/usr.bin/awk/awk.1
+++ b/usr.bin/awk/awk.1
@@ -23,7 +23,7 @@
 .\" THIS SOFTWARE.
 .\"
 .\"	$FreeBSD$
-.Dd $Mdocdate: June 6 2020 $
+.Dd July 30, 2021
 .Dt AWK 1
 .Os
 .Sh NAME
@@ -812,3 +812,11 @@ to it.
 .Pp
 The scope rules for variables in functions are a botch;
 the syntax is worse.
+.Sh DEPRECATED BEHAVIOR
+One True Awk has accpeted
+.Fl Ft
+to mean the same as
+.Fl F\t
+to make it easier to specify tabs as the separator character.
+Upstream One True Awk has deprecated this wart in the name of better
+compatibility with other awk implementations like gawk and mawk.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107310543.16V5hIUF079261>