Re: add non-option reordering to in-tree getopt_long

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: add non-option reordering to in-tree getopt_long
Дата
Msg-id ZLDW5HjNS1Ys43xP@paquier.xyz
обсуждение исходный текст
Ответ на Re: add non-option reordering to in-tree getopt_long  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: add non-option reordering to in-tree getopt_long  (Nathan Bossart <nathandbossart@gmail.com>)
Re: add non-option reordering to in-tree getopt_long  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jul 13, 2023 at 09:38:42PM -0700, Nathan Bossart wrote:
> I did notice this, but I had the opposite reaction.

Ahah, well ;)

> Take the following examples of client programs that accept one non-option:
>
>     ~$ pg_resetwal a b c
>     pg_resetwal: error: too many command-line arguments (first is "b")
>     pg_resetwal: hint: Try "pg_resetwal --help" for more information.
>
> Yet pg_ctl gives:
>
>     ~$ pg_ctl start a b c
>     pg_ctl: too many command-line arguments (first is "start")
>     Try "pg_ctl --help" for more information.
>
> In this example, isn't "a" the first extra non-option that should be
> reported?

Good point.  This is interpreting "first" as being the first option
that's invalid.  Here my first impression was that pg_ctl got that
right, where "first" refers to the first subcommand that would be
valid.  Objection withdrawn.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Autogenerate some wait events code and documentation
Следующее
От: Martin Butter
Дата:
Сообщение: 16beta2 SQL parser: different defaults on absent_on_null