Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3

From: Pádraig Brady <[email-masked]>
Date: Thu, 05 Dec 2013 23:37:59 +0000

On 12/05/2013 08:54 PM, Philipp Thomas wrote:
> The description for the -r option for shuf in 8.22-pre3 reads:
> 
> "  -r, --repetitions         output COUNT items, allowing repetition.\n"
> "                              -n 1 is implied if not specified.\n"
> 
> Which is confusing as to what COUNT relates to.

Yes this could be clearer. So the point is that --repetitions
only makes sense in the context of a specified --head-count.

How about:

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index c818a1e..5d49fef 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -4923,7 +4923,7 @@ operation modes:

 @table @samp

-@item -n @var{lines}
+@item -n @var{count}
 @itemx --head-count=@var{count}
 @opindex -n
 @opindex --head-count
diff --git a/src/shuf.c b/src/shuf.c
index f7fc936..4d0ae90 100644
--- a/src/shuf.c
+++ b/src/shuf.c
@@ -76,8 +76,8 @@ Write a random permutation of the input lines to standard output.\n\
   -n, --head-count=COUNT    output at most COUNT lines\n\
   -o, --output=FILE         write result to FILE instead of standard output\n\
       --random-source=FILE  get random bytes from FILE\n\
-  -r, --repetitions         output COUNT items, allowing repetition.\n\
-                              -n 1 is implied if not specified.\n\
+  -r, --repetitions         allow repetition within a specified --head-count\n\
+                              which is assumed to be 1, if not specified.\n\
   -z, --zero-terminated     end lines with 0 byte, not newline\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);