pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: D. S. <spider@skuggor.se>
Cc: pgsql-bugs@postgresql.org
Subject: Re: unrecognized option '--help
Date: Thu, 21 May 2015 22:58:11 -0300
Message-ID: <20150522015811.GR5885@postgresql.org> (raw)
In-Reply-To: <20213.1432259076@sss.pgh.pa.us>
References: <1432193703.4099.3.camel@skuggor.se>
	<CAB7nPqT=EThRyqmb3vixi1qa1WevMitPk2GHqY2MvOwr0aOk_w@mail.gmail.com>
	<20150522013619.GQ5885@postgresql.org>
	<20213.1432259076@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (16+ messages)  latest in thread

Message-ID: <20150522015811.GR5885@postgresql.org>
Permalink:  ../20150522015811.GR5885@postgresql.org/
Also on:    postgresql.org/message-id/20150522015811.GR5885@postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, michael.paquier@gmail.com, spider@skuggor.se
  Subject: Re: unrecognized option '--help
  In-Reply-To: <20150522015811.GR5885@postgresql.org>
  References: <1432193703.4099.3.camel@skuggor.se> <CAB7nPqT=EThRyqmb3vixi1qa1WevMitPk2GHqY2MvOwr0aOk_w@mail.gmail.com> <20150522013619.GQ5885@postgresql.org> <20213.1432259076@sss.pgh.pa.us> <20150522015811.GR5885@postgresql.org>

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

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