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

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Tue, 27 Dec 2016 09:54:18 -0800

On Tue, Dec 27, 2016 at 7:05 AM, Laslo Hunhold <dev_AT_frign.de> wrote:
> On Tue, 27 Dec 2016 15:48:56 +0100
> Mattias Andrée <maandree_AT_kth.se> wrote:
>
> Hey Mattias,
>
>> Okay, I personally do not agree with this and see echo(1)
>> as an abomination, it treats any unrecognised flags as
>> strings, but if had debate on it, keep to want you agreed
>> to.

I agree echo is an abomination. Especially with POSIX saying things
like "If the first operand is -n, or if any of the operands contain a
<backslash> character, the results are implementation-defined." The
best thing we can do is not use echo in any scripts.

I think from a philosophical standpoint sbase echo should not include
-n, to be simpler and still POSIX compliant. However pragmatically
many scripts use echo -n so I think it makes sense to keep it.

>
> I respect your opinion and have to admit that this is not an easy
> discussion. Let's wait for some feedback and see what the others think
> about it.

I side with Mattias on this one. Accepting -- even in utilities that
don't have flags has the benefits of 1) complying with POSIX so we can
be a drop in replacement 2) consistency with all the other tools.
Received on Tue Dec 27 2016 - 18:54:18 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 27 2016 - 19:00:16 CET