This one time, at band camp, Matthew Palmer said: > On Tue, Feb 15, 2005 at 03:06:19PM +0100, Francesco P. Lovergine wrote: > > On Tue, Feb 15, 2005 at 07:38:08AM -0600, John Hasler wrote: > > > Francesco P. Lovergine writes: > > > > It depends on programs, sometimes the same usage function is used for > > > > either --help or invalid options. > > > > > > Sure, but the output should still be directed correctly. > > > > Quite difficult if the function is the same. In both cases it uses stderr. > > So you change the program to take a file descriptor into the help-printing > function, or provide some other means of determining where to send the > output. I just recently sent a patch upstream for hdparm for exactly this, implemented exactly this way, since his previous implementation was a single function that was reused. It is trivial to do so, and it is also the Right Thing, IMHO. -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : sgran@debian.org | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
Attachment:
pgpBnxNBp1wI2.pgp
Description: PGP signature