>
>In section 1.11 under OPTIONS, the standard states that if the
>implementation does not an option that it should exit with a non-zero
>status.  However, the standard does allow implementations to
>recognize additional options.

This is certainly open for interpretation.

A utility which does not have any standard options ("None.")
is, IMO, not required to do any option parsing and may accept
anything passed with a leading "-" as an operand.
I think the phrase "need not support any options" leaves room
for this interpretation.

If not, the wording which forces such utilities to recognize "--"
for conforming invocations makes little sense.

>> The standard simply says that is is en error FOR AN APPLICATION to
>> call a utility in such a manner.
>No, this is not what the standard says.  A conforming application
>cannot call a utility in such a manner.  A non-conforming utility
>can do so and the behavior is unspecified.  if the implementation
>does not recognized it as an known option, then it must
>report an error.  Otherwise, it can process it however it wants.

That is what I meant to say (about conforming vs non-conforming
invocations).  I just don't believe that there is a requirement to
do option parsing when there are no standard defined options.

That is, nothing more than:

        if (argv[1] != NULL && strcmp(argv[1], "--") == 0)
                argc--, argv++;

is required.

Casper


Reply via email to