Skip to content

Commit

Permalink
awk: Flag -Ft as deprecated behavior
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bsdimp committed Jul 31, 2021
1 parent 97c0b5a commit 4e52f5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion contrib/one-true-awk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 9 additions & 1 deletion usr.bin/awk/awk.1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.\" THIS SOFTWARE.
.\"
.\" $FreeBSD$
.Dd $Mdocdate: June 6 2020 $
.Dd July 30, 2021
.Dt AWK 1
.Os
.Sh NAME
Expand Down Expand Up @@ -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.

0 comments on commit 4e52f5d

Please sign in to comment.