4 ms·
> In that case, writing to stderr is justifiable. More than justifiable, I'd say it's the correct thing to do in that case. Otherwise, the caller (which can be
by jolmg 3y ago
> In that case, writing to stderr is justifiable.
More than justifiable, I'd say it's the correct thing to do in that case. Otherwise, the caller (which can be another script) may end up working with the help message thinking it was the output it expected.
The whole rule should be something like "Print to stdout if it's part of what's asked by the caller. Print to stderr if it wasn't asked but the user should know about it." So outputting it to stdout should happen when it's asked via --help, and outputting it to stderr should happen when it's part of an error.