(0000244)
geoffclare (manager)
2009-09-28 16:46
|
That whole paragraph has more problems. Firstly, the phrase
"non-option-argument" is ambiguous: it can be parsed as
(non-option)-argument as intended, or as non-(option-argument).
Secondly, it doesn't properly account for arguments that are
option-arguments. Thirdly, it uses "option-argument" when it
means an argument that is an option. Finally, it refers to "--"
as a "special option", which it is not.
I think the most awkward complications could be avoided simply
by referring to operands.
Here is a suggested replacement paragraph:
When the end of options is encountered, the getopts utility shall
exit with a return value greater than zero; the shell variable
OPTIND shall be set to the index of the first operand, or the
value "$#"+1 if there are no operands; the name variable shall be
set to the <question-mark> character. Any of the following
shall identify the end of options: the first "--" argument that
is not an option-argument, finding an argument that is not an
option-argument and does not begin with a '-', or encountering
an error. |