News for hackers. Stuff that matters.
Re:Tell HN: Please don't print –help to stderr in your CLI t... by rahimnathwani on Saturday September 30, 2023 @04:34PM (#37719498)
cut does the right thing:

- if you run cut with no input and no parameters, it outputs an error message to STDERR

- if you run cut --help it outputs usage info to STDOUT

This is what I'd expect based on the man page. Running cut with no parameters is undefined, hence the output to STDERR. Running cut --help is defined, so the output goes to STDERR.

I think people get confused because some tools, when run without any input, output the full help info to STDERR, instead of suggesting the user run foo --help*.

So foo* and foo --help* appear to be equivalent. Until you pipe into less*.

There are no comments on this comment yet.