Re: Better error message when --single is not the first arg to postgres executable - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Better error message when --single is not the first arg to postgres executable
Date
Msg-id 4881958b-a56e-4f73-9203-ca0ab9e10581@eisentraut.org
Whole thread Raw
In response to Re: Better error message when --single is not the first arg to postgres executable  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Better error message when --single is not the first arg to postgres executable
List pgsql-hackers
On 19.06.24 16:04, Nathan Bossart wrote:
>> What about just inlining --version and --help e.g.
>>
>> else if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-V") == 0)
>> {
>>       fputs(PG_BACKEND_VERSIONSTR, stdout);
>>       exit(0);
>> }
>>
>> I'm fine with being more persnickety about the other options; they are much
>> rarer and not unixy.
> 
> That seems like it should work.  I'm not sure I agree that's the least
> surprising behavior (e.g., what exactly is the user trying to tell us with
> commands like "postgres --version --help --describe-config"?), but I also
> don't feel too strongly about it.

There is sort of an existing convention that --help and --version behave 
like this, meaning they act immediately and exit without considering 
other arguments.

I'm not really sure all this here is worth solving.  I think requiring 
things like --single or --boot to be first seems ok, and the 
alternatives just make things more complicated.



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: SQL/JSON query functions context_item doc entry and type requirement
Next
From: Peter Eisentraut
Date:
Subject: Re: What is a typical precision of gettimeofday()?