Re: [hackers] [PATCH] tar: if first argument doesn't have a leading dash, prepend one

From: Ethan Sommer <e5ten.arch_AT_gmail.com>
Date: Mon, 18 May 2020 13:51:22 -0400

On Mon, May 18, 2020 at 1:07 PM Laslo Hunhold <dev_AT_frign.de> wrote:

> On Mon, 18 May 2020 22:39:00 +0700
> Đoàn Trần Công Danh <congdanhqx_AT_gmail.com> wrote:
>
> Dear Đoàn,
>
> > Sorry, but isn't no-dash is the one specified by POSIX:
> > https://pubs.opengroup.org/onlinepubs/7908799/xcu/tar.html
> > Please excuse my ignorance, I couldn't find newer specification.
>
> no, this is no ignorance. POSIX "replaced" tar with pax(1)[0], but we
> should still, if we offer tar, follow POSIX's command line utility
> guidelines (forgot what they were called) which also specify "--" as
> end of flags, among other things. One should be able to rely on these,
> if you ask me.

One can still rely on this with this patch, a dash is only prepended to the
first argument if it isn't present, it would be present for --, and --
obviously can't appear before the first argument. This patch shouldn't
break
any currently possible usages of tar's arguments, including using the
normal
POSIX utility flag style, but makes it possible to call it in the otherwise
universally supported method with a dash-less key.

>
> With best regards
>
> Laslo
>
> [0]:https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
>
>
Received on Mon May 18 2020 - 19:51:22 CEST

This archive was generated by hypermail 2.3.0 : Mon May 18 2020 - 20:24:52 CEST