Re: [hackers] [sbase][PATCH] basename, dirname, printf: recognise -- and fail if options are used.

From: Mattias Andrée <maandree_AT_kth.se>
Date: Tue, 27 Dec 2016 15:26:09 +0100

On Tue, 27 Dec 2016 15:21:11 +0100
Laslo Hunhold <dev_AT_frign.de> wrote:

> On Tue, 27 Dec 2016 15:14:44 +0100
> Mattias Andrée <maandree_AT_kth.se> wrote:
>
> Hey Mattias,
>
> > POSIX says “--” should be supported unless stated
> > otherwise. I interpret that standard saying that this
> > also applies utilities that do not take any flags. And
> > to be on the safe side I think it is a good idea to
> > support “--” for two reasons: (1) existing scripts may
> > require it, and (2) if POSIX adds a flag to the utility
> > in the future we must support “--” now, otherwise
> > compatibility will be broken.
>
> so what about "echo --"?
>
> Cheers
>
> Laslo
>

POSIX explicitly states that echo(1) shall treat “--”
as a string operand and not as a delimiter. My guess
is that this is for historical reason, much like the
existence of echo(1) itself.

Received on Tue Dec 27 2016 - 15:26:09 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 27 2016 - 15:36:17 CET