Re: [RFC][PATCH] Print the usage string on stdout instead of stderr.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Giuseppe Scrivano venit, vidit, dixit 17.05.2010 11:48:
> Hello,
> 
> I have noticed that the -h flag uses stderr to print the usage string,
> is there any reason for it?

As a general rule, regular output goes to stdout and error reports to
stderr.

Now, usage messages are displayed on specific request (-h) as well as
when a command is used with wrong arguments. So the classification
depends on the use case! But I reckon that even with '-h', usage strings
are not exactly "regular output", so stderr looks more natural to me.

More importantly, callers expect error messages on stderr, such as usage
with wrong arguments. I don't think scripts would call commands with
'-h', and if they do they do so on purpose and can parse stderr, knowing
there is no stdout in this case.

Michael

P.S.: I guess this means NACK from me FWIIW.

> 
> The small patch I have attached changes -h to print on stdout.
> 
> Thanks,
> Giuseppe
> 

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]