[mercury-users] getopt

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 25 13:42:24 AEDT 2003

On 25-Feb-2003, Michael Day <mikeday at yeslogic.com> wrote:
> On the topic of getopt, when I create a boolean long option it appears to
> return no by default and yes if --foo is present.

The default for an option "--foo" will be whatever you set it to (in your
option_defaults procedure).  It will get set to yes if "--foo" is
present and no if "--no-foo" is present.

> However if --foo=bar or
> --foo= is present it returns no and does not give an error message. Is
> this correct behaviour? Shouldn't it complain that it is not expecting an
> argument for that option?

You're right, that seems to be a bug.
I'll have a look at it.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list