I agree with Casper's interpretation of POSIX/SUS option recognition
requirements.

I don't see anything in the standard that says that an argument with
the first character '-' has to be interpreted as an option (for
utilities that specify "None." in the OPTIONS section of their
description) and utilities are clearly allowed to treat arguments
starting with a '-' (other than "--" used as a first argument following
any arguments interpreted as options and option arguments) as an
operand.

I do not believe that the standard suggests that an implementation
needs to document that arguments starting with '-' are operands rather
than options for standard utilities with an OPTIONS section that says
"None".  The standards do say, however, that non-standard options
accepted by standard utilities SHOULD be documented.

In cases where the documentation for a standard utility says "None." in
the OPTIONS section, unless "--" is provided as the first argument an
implementation is allowed to interpret a first argument that starts
with '-' but is not exactly "-" as an unknown option or to treat it as
an operand.

An application that uses a string starting with "---" as a first
argument to the printf utility is not portable and cannot be classified
as a Strictly Conforming POSIX Application, Conforming POSIX
Application, Conforming POSIX Application Using Extensions, Strictly
Conforming XSI Application, nor as a Conforming XSI Application Using
Extensions.

 - Don


Reply via email to