Re: unrecognized option '--help

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "D(dot) S(dot)" <spider(at)skuggor(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: unrecognized option '--help
Date: 2015-05-22 01:58:11
Message-ID: 20150522015811.GR5885@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Michael Paquier wrote:
> >> It is wanted this way for all the utilities of src/bin. See
> >> handle_help_version_opts() in src/bin/scripts/common.c for your case.
>
> > Is it really wanted? I find it very annoying and wish it didn't do
> > that.
>
> I think the only thing that would do what you wanted would be to
> recognize *any* argv element matching "--help" as a help request.
> Maybe that's all right, but I'm a tad worried about the possibility
> of false positives. Are we so sure that that string could never be
> a database name, table name, etc?

Hah. This reminds me of my time at the university when guys created
files named "-fr" in other people's home directories to wreak havoc when
the poor sods wanted to remove them.

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.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-05-22 01:59:56 Re: unrecognized option '--help
Previous Message Andres Freund 2015-05-22 01:50:06 Re: unrecognized option '--help