Re: [patch] pg_test_timing does not prompt illegal option

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: "Zhang, Jie" <zhangjie2(at)cn(dot)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [patch] pg_test_timing does not prompt illegal option
Date: 2019-04-17 14:24:17
Message-ID: 29470.1555511057@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> On Wed, Apr 17, 2019 at 6:21 PM Zhang, Jie <zhangjie2(at)cn(dot)fujitsu(dot)com> wrote:
>> I think "--" is a illegal option, errors should be prompted.

> This is not the problem only for pg_test_timing. If you want to
> address this, the patch needs to cover all the client commands
> like psql, createuser. I'm not sure if it's worth doing that.

I think it might be an actively bad idea. There's a pretty
widespread convention that "--" is a no-op switch indicating
the end of switches. At least some of our tools appear to
honor that behavior (probably because glibc's getopt_long
does; I do not think we are implementing it ourselves).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-17 15:34:20 Idea for fixing parallel pg_dump's lock acquisition problem
Previous Message Fujii Masao 2019-04-17 14:14:19 Re: [patch] pg_test_timing does not prompt illegal option