[Issue 18019] getopt worng behaviour (ConvException instead of GetOptException)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 29 14:15:53 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18019

Basile B. <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com
           Hardware|x86_64                      |All
                 OS|Windows                     |All

--- Comment #1 from Basile B. <b2.temp at gmx.com> ---
(In reply to Dmitry from comment #0)
> [...]
> 1) Why "-help" and "-replace" was recognized as options? They contains more
> than one letter and bundling is disabled (as default).
> 2) At least, the behaviour should be same - "-replace" should throw
> GetOptException.
> 
> If I don't understand something obvious, correct me, please.

with "-replace"  It tries to detect "-rtrue" or "-rfalse", which is the short
option + the boolean value for it. The ConvError is then caused by
"to!bool("eplace")".

I'm not sure if this report is valid but it's still possible to throw a better
exception with "expected true or false following simple option" or something
like that.

Maybe you can change the report title. "Better error message for short option
followed by wrong bool string".... + set it as enhancement, assuming you'd
agree that the real problem is that of course.

--


More information about the Digitalmars-d-bugs mailing list