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

On 7/8/20 7:43 PM, John Cowan wrote:
> It's a real ambiguity: if -o takes an optional argument, then is -obar
> the -o flag with bar, or is it the flags -o -b -a -r?  I think the GNU
> rules are intended to discourage the first interpretation.

Are you sure? I would say it mandates the first interpretation.

"Two colons mean an option takes an optional arg; if there is text in
the current argv-element (i.e., in the same word as the option name
itself, for example, "-oarg"), then it is returned in optarg, otherwise
optarg is set to zero."

--
Anthony Carrico