Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvcOR-0006Gw-IM for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:08:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvcOQ-0000Jq-U3 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:08:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvcOQ-0000Jk-6g for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:08:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YvcON-00042P-Rx for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:08:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4M28gs3020932; Thu, 21 May 2015 22:08:42 -0400 From: Tom Lane To: Alvaro Herrera cc: Michael Paquier , "D. S." , pgsql-bugs@postgresql.org Subject: Re: unrecognized option '--help In-reply-to: <20150522015811.GR5885@postgresql.org> References: <1432193703.4099.3.camel@skuggor.se> <20150522013619.GQ5885@postgresql.org> <20213.1432259076@sss.pgh.pa.us> <20150522015811.GR5885@postgresql.org> Comments: In-reply-to Alvaro Herrera message dated "Thu, 21 May 2015 22:58:11 -0300" Date: Thu, 21 May 2015 22:08:42 -0400 Message-ID: <20931.1432260522@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alvaro Herrera 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