(main): Issue a warning for obsolete usage, unless POSIXLY_CORRECT.
authorJim Meyering <jim@meyering.net>
Fri, 18 Jan 2002 23:40:06 +0000 (23:40 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 18 Jan 2002 23:40:06 +0000 (23:40 +0000)
src/uniq.c

index c61468c..b3b16ff 100644 (file)
@@ -443,7 +443,13 @@ main (int argc, char **argv)
                && optarg[0] == '+'
                && xstrtoul (optarg, NULL, 10, &size, "") == LONGINT_OK
                && size <= SIZE_MAX)
-             skip_chars = size;
+             {
+               if (! posixly_correct)
+                 error (0, 0,
+                        _("warning: `uniq %s' is obsolete; use `uniq -s %s' instead"),
+                        optarg, optarg + 1);
+               skip_chars = size;
+             }
            else if (nfiles == 2)
              {
                error (0, 0, _("extra operand `%s'"), optarg);