When printing the "usage" of an application, should it be done on stdout or on stderr?
Depending on the application I've seen several cases, but there doesn't seem to be one rule. Maybe I'm mistaken and there is one good practice. In that case, what is it?
if
--help
then stdout, else stderr. Here's the JCommander code for Java users:I think it depends on the organization's coding standards. Outside an organization, its probably one of those topics that are endlessly debated, like which is the best operating system, which is the best editor, which is the right religion, ...
Browsing Java Code Conventions (SEPT 1997), Java does not specify it. There is no answer, and it will be endlessly debated.
According to GNU's coding standards, it should be printed on standard output:
Here's the related topic of "version". Its also from the GNU coding guide, and it also writes to standard output: