Pádraig Brady wrote:
> I notice that `pr -S` takes an optional arg,
> but the docs say it's required.
> Should I fix the docs or the code?
Thanks for checking, and good point.
The "Mandatory arguments to long options are mandatory for short options too."
statement doesn't apply to optional arguments.
--help implies it's optional with the long-named option,
"--sep-string[=STRING]":
-SSTRING, --sep-string[=STRING]
separate columns by STRING,
without -S: Default separator <TAB> with -J and <space>
otherwise (same as -S" "), no effect on column options
coreutils.texi says this:
`-SSTRING'
`--sep-string[=STRING]'
Use STRING to separate output columns. The `-S' option doesn't
affect the `-W/-w' option, unlike the `-s' option which does. It
does not affect line truncation or column alignment. Without
`-S', and with `-J', `pr' uses the default output separator, TAB.
Without `-S' or `-J', `pr' uses a `space' (same as `-S" "').
`--sep-string' with no `=STRING' is equivalent to
`--sep-string=""'.
You're welcome to make it clearer that the -S option arg is also optional.