From: Jim Meyering Date: Fri, 18 Jan 2002 23:39:37 +0000 (+0000) Subject: (parse_obsolescent_option): Issue a warning for obsolete usage, X-Git-Tag: TEXTUTILS-2_0_20~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a755a3d27ab8b94585a7aeb1a8fb45dfe820599;p=thirdparty%2Fcoreutils.git (parse_obsolescent_option): Issue a warning for obsolete usage, unless POSIXLY_CORRECT. --- diff --git a/src/tail.c b/src/tail.c index d00a89d6d1..2131c1d4b5 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1381,10 +1381,10 @@ parse_obsolescent_option (int argc, const char *const *argv, if (!*fail) { + bool posix_pedantic = (getenv ("POSIXLY_CORRECT") != NULL); + if (argc > 3) { - int posix_pedantic = (getenv ("POSIXLY_CORRECT") != NULL); - /* When POSIXLY_CORRECT is set, enforce the `at most one file argument' requirement. */ if (posix_pedantic) @@ -1405,6 +1405,11 @@ option instead."), argv[1]); #endif } + if (! posix_pedantic) + error (0, 0, + _("warning: `tail %s' is obsolete; use -n or -c instead"), + argv[1]); + /* Set globals. */ from_start = t_from_start; count_lines = t_count_lines;