Re: unrecognized option '--help - Mailing list pgsql-bugs

From Tom Lane
Subject Re: unrecognized option '--help
Date
Msg-id 20931.1432260522@sss.pgh.pa.us
Whole thread Raw
In response to Re: unrecognized option '--help  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-bugs
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> If you have a database called --help you should probably still be able
> to connect to it using any of:

>   psql --dbname=--help
>   psql -d --help
>   psql -- --help

> I think it's perfectly reasonable to not recognize --help when it can be
> considered an argument to the previous option.

But then you have the problem that --help will only work if you spelled
everything to its left correctly, or at least close enough that getopt
doesn't see a problem with it.

I did have an evil thought about this ... what about recognizing --help
as either the first or last argument, but not in between?  That would
fix Alvaro's use-case, and for the 0.01% of cases where it's problematic,
I suspect it's always possible to rearrange the command so that the --help
argument doesn't have to be last.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: unrecognized option '--help
Next
From: Andres Freund
Date:
Subject: Re: unrecognized option '--help