summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-01-18 23:40:06 +0000
committerJim Meyering <jim@meyering.net>2002-01-18 23:40:06 +0000
commitc8aa23a9cc2a8de24fcd37c5513eb70a6dfd61a3 (patch)
treeaab03f33e1dda0e95bb69f3f9ee333e1e8ad4b34
parent8a755a3d27ab8b94585a7aeb1a8fb45dfe820599 (diff)
downloadcoreutils-c8aa23a9cc2a8de24fcd37c5513eb70a6dfd61a3.tar.xz
(main): Issue a warning for obsolete usage, unless POSIXLY_CORRECT.
-rw-r--r--src/uniq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/uniq.c b/src/uniq.c
index c61468c26..b3b16ffb3 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -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);