Re: [hackers] [sbase][PATCH] Support -- in all utilities except echo(1)

From: Michael Forney <mforney_AT_mforney.org>
Date: Fri, 28 Jun 2019 01:21:44 -0700

On 2019-06-28, Michael Forney <mforney_AT_mforney.org> wrote:
> As far as I know, unless the documentation states that a utility shall
> conform to the Utility Syntax Guidelines, it is not required to
> support `--`. However, it does use the language "should" which
> means[2]:
>
> For an implementation that conforms to POSIX.1-2017, describes a
> feature or behavior that is recommended but not mandatory.

I found a section in POSIX that is a bit more explicit about this, and
it looks like handling `--` is indeed required. See the OPTIONS
section in

https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap01.html#tag_17_04

        Default Behavior: When this section is listed as "None.",
        it means that the implementation need not support any
        options. Standard utilities that do not accept options,
        but that do accept operands, shall recognize "--" as a first
        argument to be discarded.

        The requirement for recognizing "--" is because conforming
        applications need a way to shield their operands from any
        arbitrary options that the implementation may provide as
        an extension.
Received on Fri Jun 28 2019 - 10:21:44 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 28 2019 - 11:00:25 CEST