Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter@eisentraut.org>, Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Matthias Hörmann <matthias.hoermann@saltation.com>, pgsql-bugs@lists.postgresql.org
Date: 2025-10-27T14:30:36Z
Lists: pgsql-bugs
On Sat, Oct 25, 2025 at 12:26:01AM +0200, Daniel Gustafsson wrote: > While hacking on this it seemed like a good idea to move to using progname > consistently, and reduce scope in some places from global variables, but > looking at it now I'm less convinced. At the very least it should be ripped > out into its own patch but for now those changes are left in there. Yeah, that does feel like it ought to be its own patch. After a read-through, 0001 looks like the right idea to me, though. It's a larger patch, but the majority of the changes are pretty mechanical. +/* port/pg_option_utils.c */ +extern bool is_help_param(int argc, char *argv[], int optind); And fe_utils/option_utils.c, right (since it has a copy of this function)? Or is the idea to use pg_option_utils.c for both the frontend and the backend? > It's far from an exciting patchset but it would be nice to get it done once and > for all. 0002 is a small change to make sure all apps exit with the same code, > I was unable to find a documented rationale for exit(2) so I think it's an > oversight. 0002 LGTM -- nathan