Optional option argument Shiro Kawai (07 Jul 2020 02:44 UTC)
Re: Optional option argument Marc Nieper-Wißkirchen (07 Jul 2020 09:35 UTC)
Re: Optional option argument Anthony Carrico (08 Jul 2020 16:49 UTC)
(missing)
Re: Optional option argument Anthony Carrico (08 Jul 2020 23:41 UTC)
Re: Optional option argument John Cowan (08 Jul 2020 23:43 UTC)
Re: Optional option argument Anthony Carrico (09 Jul 2020 00:05 UTC)
Re: Optional option argument John Cowan (09 Jul 2020 00:07 UTC)
Re: Optional option argument Anthony Carrico (09 Jul 2020 00:18 UTC)
Re: Optional option argument John Cowan (09 Jul 2020 00:22 UTC)
Re: Optional option argument Arthur A. Gleckler (30 Nov 2020 19:24 UTC)
Re: Optional option argument Anthony Carrico (30 Nov 2020 21:12 UTC)
Re: Optional option argument Arthur A. Gleckler (01 Dec 2020 00:56 UTC)
Re: Optional option argument Eugenio Montano (01 Dec 2020 01:50 UTC)
Re: Optional option argument Arthur A. Gleckler (01 Dec 2020 01:57 UTC)
Re: Optional option argument Anthony Carrico (01 Dec 2020 14:18 UTC)
Re: Optional option argument Shiro Kawai (08 Jul 2020 19:27 UTC)
Re: Optional option argument Anthony Carrico (08 Jul 2020 23:57 UTC)
Fwd: Optional option argument Arthur A. Gleckler (07 Jul 2020 17:34 UTC)
Re: Fwd: Optional option argument Anthony Carrico (08 Jul 2020 16:10 UTC)
Re: Fwd: Optional option argument Arthur A. Gleckler (08 Jul 2020 19:29 UTC)

Re: Optional option argument Anthony Carrico 09 Jul 2020 00:18 UTC

On 7/8/20 8:07 PM, John Cowan wrote:
> yes, I meant the second option; I myself would favor the first, but
> that's not what GNU says.

What? I think we are missing each other.

The GNU spec says "if there is text in the current argv-element then it
is returned in optarg, otherwise optarg is set to zero". That is the
first option.

1. argv-element is "-obar"
2. o is recognized as an option taking an optional arg.
3. the text "bar" is still in the current argv-element
4. so "bar" is returned in optarg.

This was your first option.

This also means that "-o bar" gets no argument (which is strange).

--
Anthony Carrico