Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Matthias Hörmann <matthias.hoermann@saltation.com>, Daniel Gustafsson <daniel@yesql.se>, pgsql-bugs@lists.postgresql.org
Date: 2025-09-10T05:26:10Z
Lists: pgsql-bugs
On 03.09.25 21:34, Andres Freund wrote: > 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 think in the olden days we didn't have universal getopt_long() support, so it was hardcoded. I don't see a problem with changing it. > 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. Right. If you try the usual GNU utilities, they handle --help and --version at any argument position.