From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
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:08:42 -0400
Message-ID: <20931.1432260522@sss.pgh.pa.us> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, michael.paquier@gmail.com, spider@skuggor.se
Subject: Re: unrecognized option '--help
In-Reply-To: <20931.1432260522@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> <20150522015811.GR5885@postgresql.org> <20931.1432260522@sss.pgh.pa.us>
* 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