Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Matthias Hörmann <matthias(dot)hoermann(at)saltation(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore
Date: 2025-09-03 19:34:36
Message-ID: 53lkszuko3qwk4sn6mxz5dl6yahkosrksm3pcxjikcuxj3vssq@jwzipa3ikold
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2025-09-03 10:57:53 -0400, Tom Lane wrote:
> Matthias =?utf-8?Q?H=C3=B6rmann?= <matthias(dot)hoermann(at)saltation(dot)com> writes:
> > The 2025-09-03 13:45:15, Daniel Gustafsson wrote:
> >> This is the intended behaviour, --help (and --version) is parsed specially and
> >> must be the first parameter. We do this for all command line utilities.
>
> > Well, the use-case that comes up quite often for me (for any commands,
> > not just postgres) is that I add parameters I know or remember from my
> > last look at --help and then want to check again what else to add, for
> > that it is useful to be able to use --help as the last parameter.
>
> FWIW, I agree with this. While I don't try to do that with PG
> utilities (since I know it doesn't work), I frequently rely on that
> behavior of our configure script. I'd be in favor of recognizing
> --help (though probably not -?) in any argument position. Less sure
> about --version.

I've been annoyed by this behaviour for a long time.

So +many for recognizing --help (and I'd say -?) everywhere, not just as the
first argument. I never understood why we don't do that.

I don't think the argument for --version is particularly strong from a
usability perspective, but I don't see what we gain from parsing --version/-V
differently than we do all the other arguments. It seems best to just handle
--version the same as all the other arguments.

Greetings,

Andres

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-09-03 20:10:52 Re: BUG #18960: Mistake in test test_simple_pipeline (libpq_pipeline.c)
Previous Message Tom Lane 2025-09-03 19:22:30 Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore