std.getopt error

growler growlercab at gmail.com
Mon Aug 26 02:33:36 PDT 2013


On Monday, 26 August 2013 at 07:20:11 UTC, Ramon wrote:
> On Monday, 26 August 2013 at 07:06:07 UTC, growler wrote:
>> Given:
>>
>> int colOrder = 1;
>> ...
>> Could it be that "-c 1" is ignored because it is in invalid 
>> and the default colOrder value is used?
>
> Sorry for expressing myself clumsily.
>
> if the commandline arg is "-c 1" (which according to getopt doc 
> is illegal) it actually *does* work properly.
>
> if the commandline arg is "-c1" (which  according to getopt doc 
> is legal) then the result of getopt is false/wrong.
> "-c 1" then sets the variable to -1.
>
> Same with 2. So the problem is not 1 or 1 being the var default.
>
> Thanks - R

Cool, sorry for the noise. I was in a hurry leaving work and 
didn't have time to test the idea.

Cheers,
G


More information about the Digitalmars-d mailing list