delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/30/14:22:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Bernard A Badger" <bab AT vx DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: trivial mkpasswd defect
Date: Thu, 30 May 2002 14:23:34 -0400
Message-ID: <INEKLKBFCDBPKMKAJLMDCEKFCDAA.bab@vx.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
In-Reply-To: <20020530151956.GD32609@redhat.com>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700

> -----Original Message-----
> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf
> Of Christopher Faylor
> Sent: Thursday, May 30, 2002 11:20 AM
> To: cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019