summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-02-09 04:44:47 +0000
committerJim Meyering <jim@meyering.net>1997-02-09 04:44:47 +0000
commit562488ee9c86692635a9784c993f57dd3ce8adc7 (patch)
treea43e00bc430d793e5607320198d4ec2ed90247ac /src/tail.c
parent3e9c9be49e35227ef1e97efddef7c5f09463f67d (diff)
downloadcoreutils-562488ee9c86692635a9784c993f57dd3ce8adc7.tar.xz
(parse_obsolescent_option): Give warning diagnostic for
(but now accept) obsolescent usage with more than one file argument.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tail.c b/src/tail.c
index b7fc0587b..12a5ca1dd 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -874,9 +874,9 @@ parse_obsolescent_option (int argc, const char *const *argv,
int t_count_lines;
int t_forever;
- /* With the obsolescent form, there is one option string and at most
- one file argument. */
- if (argc < 2 || argc > 3)
+ /* With the obsolescent form, there is one option string and
+ (technically) at most one file argument. But we allow two or more. */
+ if (argc < 2)
return 0;
/* If I were implementing this in Perl, the rest of this function
@@ -975,6 +975,14 @@ parse_obsolescent_option (int argc, const char *const *argv,
if (!*fail)
{
+ if (argc > 3)
+ {
+ error (0, 0, _("\
+Warning: it is not portable to use two or more file arguments with\n\
+tail's obsolescent option syntax (%s). Use the equivalent -n or -c option\n\
+to avoid this warning."), argv[1]);
+ }
+
/* Set globals. */
from_start = t_from_start;
count_lines = t_count_lines;