From: Jim Meyering Date: Sun, 9 Feb 1997 04:44:47 +0000 (+0000) Subject: (parse_obsolescent_option): Give warning diagnostic for X-Git-Tag: SH-UTILS-1_16a~255 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=562488ee9c86692635a9784c993f57dd3ce8adc7;p=thirdparty%2Fcoreutils.git (parse_obsolescent_option): Give warning diagnostic for (but now accept) obsolescent usage with more than one file argument. --- diff --git a/src/tail.c b/src/tail.c index b7fc0587b7..12a5ca1dd7 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;