]> git.ipfire.org Git - thirdparty/coreutils.git/commit
shuf: add --repetition to support repetition in output
authorAssaf Gordon <assafgordon@gmail.com>
Thu, 4 Jul 2013 19:26:45 +0000 (13:26 -0600)
committerPádraig Brady <P@draigBrady.com>
Thu, 11 Jul 2013 00:17:31 +0000 (01:17 +0100)
commit3a84293987bd21a92071a3d1c605ec9a2b3af1b4
tree66aedec3a3800ba35045921fadb63fea557077e6
parentf3fa3b2990c13623b80439039a92f72e08bb42be
shuf: add --repetition to support repetition in output

main(): Process new option.  Replace input_numbers_option_used()
with a local variable.  Re-organize argument processing.
usage(): Describe the new option.
(write_random_numbers): A new function to generate a
permutation of the specified input range with repetition.
(write_random_lines): Likewise for stdin and --echo.
(write_permuted_numbers):  New function refactored from
write_permuted_output().
(write_permuted_lines): Likewise.
* tests/misc/shuf.sh: Add tests for --repetitions option.
* doc/coreutils.texi: Mention --repetitions, add examples.
* TODO: Mention an optimization to avoid needing to
read all of the input into memory with --repetitions.
* NEWS: Mention new shuf option.
NEWS
doc/coreutils.texi
src/shuf.c
tests/misc/shuf.sh