Re: Shouldn't getopt_long() return ':' for options requiring an argument?
Date: Sun, 24 Apr 2005 22:06:06 +0200
"Måns Rullgård" <email@example.com> wrote:
> "Eric Lilja" <firstname.lastname@example.org> writes:
>> Hello, consider this C program and its accompanying test script:
>> As you can see, getopt_long() returns '?' for the case where the option
>> requires arguments and none was supplied, I was under the impression that
>> should return ':' for that case and '?' for unknown options (it prints
>> correct diagnostic, though). Is this a bug in the implementation of
>> getopt_long() on my system or are there simply different valid variants
>> the implementation?
> man 3 getopt:
> If the first character (following any optional '+'or '-'
> above) of optstring is a colon (':'), then getopt() returns ':'
> of '?' to indicate a missing option argument.
Hmm, I must be daft or something, but does that mean that getopt_long() only
returns ':' if the user had supplied --:option_with_argument on the command
> Måns Rullgård
- Re: Shouldnt getopt_long() return : for options requiring an argument?
... > requires arguments and none was supplied, I was under the impression that it ... Is this a bug in the implementation of ... man 3 getopt: ... Måns Rullgård ...
- Re: Vladimir Bondarenko and Maplesoft
... You given the wrong impression. ... Do you think if you found the name of someone in IBM, Intel, Texas Instruments etc etc. and sent them in the post your latest bug several times per day, that they might just get a bit fed up with it? ... I'm not sure it is a particularly fundamental question. ... Dave K MCSE. ...
- Re: The slow and the curious
... >>>I was under the impression they weren't brought into Canada. ... I had sat in 3 different seats in his car under duress. ... Maybe the market is ready for another Volkswagen bug. ... >> Jane, ugly, no frills but practical transportation. ...
- Test-driven development and code size (was: What is a good way of having several versions of a p
... My impression is that failing to have reliable code adds a lot of time ... Instead, in code that has unit tests, a bug found means another unit ... With test-driven development I get much closer to the "sooner" end of ...
- Re: strange effect with [:lower:] in perl
... On Tue, 28 Oct 2003, Ben Morrow wrote: ... >> That would surely have to be categorised as a bug? ... for quite some months now you'll maybe get the impression that I was ... POSIX regex constructs in versions of Perl before 5.6, ...