This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: trivial mkpasswd defect


> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Christopher Faylor
> Sent: Thursday, May 30, 2002 11:20 AM
> To: cygwin@cygwin.com
> Subject: Re: trivial mkpasswd defect
>
> On Thu, May 30, 2002 at 09:19:18AM -0400, Bernard A Badger wrote:
> >In this (POSIX) example,
> >http://www.opengroup.org/onlinepubs/007904975/functions/getopt.html
> >-? (or some other error such as -a and -b together) was the only way
> >to generate the usage string.  The GNU standard is a bit more friendly,
> >requiring a consistent error-free way to generate usage.
> >
> >Using --help (GNU required) or -h (AFAICS optional) should be considered
> >successful, and should return 0.
>
> Have you actually tried the latest version of the cygwin utilities?  The
> cygwin snapshots contain the very latest version of things like 'mount'.
> Joshua Daniel Franklin has expended considerable effort in regularizing
> the output of the commands wrt --help and usage output.
Not to this point.  I was responding to what people wrote.
Don't try to confuse the issue with the facts. ;-)

Corinna Vinschen said something ambiguous about -?, and that's what got me
started.
> > > 	$ mkpasswd -?
> > > 	mkpasswd: unknown option -- ?
> >
[Corinna]
> > Thanks.  This will go away in the next version.
[ME]
> I hope you mean that '-?' will work, not that '-?' will be taken out of the
> usage.
It is ambiguous because it isn't clear from the message what "this" refers to.

Of course, it was clear to Corinna Vinschen, and the patch submitter, Joshua D.
Franklin.

He said:
> She meant what she said. See
> http://cygwin.com/ml/cygwin-patches/2002-q2/msg00103.html
> for details. Or better yet, the CVS.

To me "what she said" was ambiguous.

Now, if I bother to check out the un-mentioned antecedents, by
looking in Mr. Franklin's patch,
http://cygwin.com/ml/cygwin-patches/2002-q2/msg00103/mkpasswd.c-patch
I have discovered these facts:
1) Nice patch!
2) -?, didn't change, it still prints out
	Try `mkpasswd --help' for more information.
3) The help message can, as always, only be printed using --help, or -h.
4) The help message erroneously said that -? would print the help message.
This is common POSIX practice, if the help message is short.
With GNU getopt_long, the messages are usually a bit more verbose,
and GNU requires --help anyway.
Thus -? often just says, in effect, "try '--help'".
5) The patch fixes this, typo,
"   -?,--help               displays this message\n\n"
into
"   -h,--help               displays this message\n"
I had thought that they were saying that they were changing mkpasswd to use
-h instead of -?.  What they were doing was changing the documentation to
match the program.

So, I'm happy now.
mkpasswd -h is fully documented, and
mkpasswd -? still produces a helpful error message.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]