Skip to content

shuf option descriptions are different from GNU, which could cause some confusion #193

Open

Description

@JalonSolov

Help output differences...

Current shuf:

shuf (V coreutils) 0.0.1
-----------------------------------------------
Usage: shuf [options] [ARGS]

Description: Shuffles its input by outputting a random permutation of its input lines

Options:
  -e, --echo                Treat each command-line operand as an input line
  -i, --input-range <string>
                            Act as if input came from a file containing the range of unsigned decimal integers lo…hi, one per line
  -n, --head-count <int>    Output at most count lines. By default, all input lines are output
  -o, --output <string>     Write output to output-file instead of standard output
  --random-source <string>  Use file as a source of random data used to determine which permutation to generate
  -r, --repeat              Repeat output values
  -z, --zero-terminated     Delimit items with a zero byte rather than a newline
  -h, --help                display this help and exit
  --version                 output version information and exit

Help us make V Coreutils better, by contributing your suggestions,
ideas and pull requests in https://github.com/vlang/coreutils

GNU shuf:

Usage: shuf [OPTION]... [FILE]
  or:  shuf -e [OPTION]... [ARG]...
  or:  shuf -i LO-HI [OPTION]...
Write a random permutation of the input lines to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -e, --echo                treat each ARG as an input line
  -i, --input-range=LO-HI   treat each number LO through HI as an input line
  -n, --head-count=COUNT    output at most COUNT lines
  -o, --output=FILE         write result to FILE instead of standard output
      --random-source=FILE  get random bytes from FILE
  -r, --repeat              output lines can be repeated
  -z, --zero-terminated     line delimiter is NUL, not newline
      --help        display this help and exit
      --version     output version information and exit

Report bugs to: bug-coreutils@gnu.org
GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
General help using GNU software: <https://www.gnu.org/gethelp/>
Full documentation <https://www.gnu.org/software/coreutils/shuf>
or available locally via: info '(coreutils) shuf invocation'

Activity

  1. changed the title [-]shuf options are different from GNU, which could cause some confusion[/-] [+]shuf option descriptions are different from GNU, which could cause some confusion[/+] on Dec 23, 2025
  2. metif12 commented on Oct 6, 2026

    @metif12
    Contributor

    The four options that take an argument now carry an equals sign, which is the part
    of GNU's spelling that carries the meaning:

      -i, --input-range =LO-HI   treat each number LO through HI as an input line
      -n, --head-count =COUNT    output at most COUNT lines
      -o, --output =FILE         write result to FILE instead of standard output
          --random-source =FILE  get random bytes from FILE
    

    One limitation worth recording, because it is not fixable from this repository: the
    flag module builds each line as '--${f.name} ${f.val_desc}', with a hardcoded space
    between the name and the argument. So this produces --input-range =LO-HI and not
    GNU's --input-range=LO-HI. Getting the exact spelling would mean changing
    vlib/flag/flag.v:680, which is in the V compiler.

    The remaining differences are the same kind of thing: GNU prints a line reading
    "Mandatory arguments to long options are mandatory for short options too." and a
    footer pointing at its own online help, and this repository's common module prints a
    different footer instead.

  3. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions