diff options
author | Jim Meyering <jim@meyering.net> | 2002-01-18 23:39:37 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-01-18 23:39:37 +0000 |
commit | 8a755a3d27ab8b94585a7aeb1a8fb45dfe820599 (patch) | |
tree | e864491ddcef54a457b17318840f574991c319a6 | |
parent | 36a16de45cb007ddc44490c82b023c9e1389d4b4 (diff) | |
download | coreutils-8a755a3d27ab8b94585a7aeb1a8fb45dfe820599.tar.xz |
(parse_obsolescent_option): Issue a warning for obsolete usage,
unless POSIXLY_CORRECT.
-rw-r--r-- | src/tail.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |