[Mailman-Developers] usage() going to stderr

Donn Cave donn@u.washington.edu
Mon Oct 21 21:58:16 2002


Quoth barry@python.org (Barry A. Warsaw):
| >>>>> "JP" == Jon Parise <jon@csh.rit.edu> writes:
|
|     JP> 'vim --help' spits its usage output to stdout, as does 'python
|     JP> -h'.
|
|     JP> I can understand errors being printed to syserr (duh), but
|     JP> usage information is more consumer grade, I think.
|
| I could almost be convinced that usage(0) should go to stdout, but I'm
| not sure it's worth changing all the scripts.  At least we're
| consistent. :)

Consistent with general practice, too, the way I see it.  The clearest
cases are programs that generate useful output data, like list_members.
Those should never mix that data with diagnostic output of any kind, so
the user can safely redirect into some other program with the expectation
of getting only that output data.

"rmlist 2>&1 | more" isn't all that convenient, but it's far easier
than separating outputs that have been mixed inappropriately.  If it's
useful, a shell function like "amore () { "$@" 2>&1 | more; }" would be
easier on the fingers.

Incidentally, I note an inconsistency - "mailmanctl" is coded to write
usage to sys.stderr, but stderr is gimmicked by LogStdErr and actually
goes to unit 1, not unit 2.

	Donn Cave, donn@u.washington.edu