From 8a755a3d27ab8b94585a7aeb1a8fb45dfe820599 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 18 Jan 2002 23:39:37 +0000 Subject: (parse_obsolescent_option): Issue a warning for obsolete usage, unless POSIXLY_CORRECT. --- src/tail.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tail.c b/src/tail.c index d00a89d6d..2131c1d4b 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; -- cgit v1.2.3-54-g00ecf