Re: [patch] pg_test_timing does not prompt illegal option

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "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 20:10:55
Message-ID: alpine.DEB.2.21.1904172205280.26370@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> We've generally felt that deferring to the behavior of the platform's
> getopt() or getopt_long() is a better idea than trying to enforce some
> lowest-common-denominator version of switch parsing, on the theory that
> users of a given platform will be used to whatever its getopt does.
> This does mean that we have undocumented behaviors on particular
> platforms.

Interesting.

> I'd say that accepting "--" is one of them. Another example is that
> glibc's getopt is willing to reorder the arguments, so that for example
> this works for me:
>
> $ psql template1 -E
> psql (12devel)

Yep, I noticed that one by accident once.

> On other platforms that would not work, so we don't document it.

People might get surprised anyway, because the very same command may or
may not work depending on the platform. Does not matter much, though.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-04-17 20:14:44 Re: jsonpath
Previous Message Dmitry Dolgov 2019-04-17 20:02:24 Re: Status of the table access method work