Thread overview
[Issue 18019] getopt wrong behaviour (ConvException instead of GetOptException)
[Issue 18019] getopt worng behaviour (ConvException instead of GetOptException)
Nov 29, 2017
Basile B.
Nov 29, 2017
Dmitry
Nov 30, 2017
Dmitry
[Issue 18019] getopt: different behaviour for built-in and custom options
Dec 06, 2017
Dmitry
Mar 21, 2020
Basile-z
Dec 17, 2022
Iain Buclaw
November 29, 2017
https://issues.dlang.org/show_bug.cgi?id=18019

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

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

--- Comment #1 from Basile B. <b2.temp@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.

--
November 29, 2017
https://issues.dlang.org/show_bug.cgi?id=18019

--- Comment #2 from Dmitry <dmitry@indiedev.ru> ---
Thank you for the explanation. Now I found it in the documentation:

> If the option has a parameter, that must be "stuck" to the option without any intervening space or "="

But it is not the reason why the issue was created. Main reason is that
behavoiur is different for "-help" (built-in option) and "-replace" (custom
option).

--
November 30, 2017
https://issues.dlang.org/show_bug.cgi?id=18019

Dmitry <dmitry@indiedev.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|getopt worng behaviour      |getopt wrong behaviour
                   |(ConvException instead of   |(ConvException instead of
                   |GetOptException)            |GetOptException)

--
December 06, 2017
https://issues.dlang.org/show_bug.cgi?id=18019

Dmitry <dmitry@indiedev.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|getopt wrong behaviour      |getopt: different behaviour
                   |(ConvException instead of   |for built-in and custom
                   |GetOptException)            |options

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=18019

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18019

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

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

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10272

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--