public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Robert Haas <[email protected]>
Cc: Daniel Westermann (DWE) <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: pg_basebackup and error messages dependent on the order of the arguments
Date: Thu, 03 Oct 2024 15:32:31 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+Tgmoaz0B7DOHPJ=hOAEPx0mEPO0nizZh+vCERwyDzZUNUM1A@mail.gmail.com>
References: <GV0P278MB0419B8F0577DDAE48AF0CB5AD2762@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM>
	<[email protected]>
	<[email protected]>
	<GV0P278MB0419BDE2D5D3E2C5C19EF411D2762@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM>
	<[email protected]>
	<GV0P278MB0419524178F42D24DEF39C29D2702@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM>
	<CA+Tgmoaz0B7DOHPJ=hOAEPx0mEPO0nizZh+vCERwyDzZUNUM1A@mail.gmail.com>

Robert Haas <[email protected]> writes:
> On Wed, Oct 2, 2024 at 6:00 AM Daniel Westermann (DWE)
> <[email protected]> wrote:
>> Maybe checking if a valid "-D" or "--pgdata" was given and return a more generic error message would be an option?

> It doesn't really seem reasonable to me to make the tools guess
> whether somebody left out the argument to an option that requires an
> argument. Consider these equivalent cases:
> ...
> I assume there are similar cases that don't involve PostgreSQL at all.

Yeah.  This has to be a standard problem for anything that uses getopt
or getopt_long at all.  Unless there's a standard approach (which I've
not heard of) to resolving these ambiguities, I'm not sure that we
should try to outsmart everybody else.

In the case of getopt_long there's an additional problem, which is
that that function itself may contain heuristics that rearrange the
argument order based on what looks like a switch or not.  It's likely
that anything we did on top of that would behave differently depending
on which version of getopt_long it is.

			regards, tom lane






view thread (5+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pg_basebackup and error messages dependent on the order of the arguments
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox