Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yvce5-0006s2-80 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:25:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yvce4-0003i3-Jj for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:25:08 +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 1Yvce3-0003hC-GL for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:25:07 +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 1Yvce1-0004KY-1d for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:25:06 +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 t4M2OvGW021332; Thu, 21 May 2015 22:24:57 -0400 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Michael Paquier , "D. S." , pgsql-bugs@postgresql.org Subject: Re: unrecognized option '--help In-reply-to: <20150522021319.GG2028@alap3.anarazel.de> References: <1432193703.4099.3.camel@skuggor.se> <20150522013619.GQ5885@postgresql.org> <20213.1432259076@sss.pgh.pa.us> <20150522015006.GF2028@alap3.anarazel.de> <20675.1432259996@sss.pgh.pa.us> <20150522021319.GG2028@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 22 May 2015 04:13:19 +0200" Date: Thu, 21 May 2015 22:24:57 -0400 Message-ID: <21331.1432261497@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 Andres Freund writes: > On 2015-05-21 21:59:56 -0400, Tom Lane wrote: >> This use-case is only going to work reliably if --help is recognized >> regardless of what's in front of it. Otherwise, if you're right in >> suspecting that you got something wrong, getopt parsing will fail >> before it gets to your --help --- and what it will print is "please >> use --help", which is exactly the symptom being complained of here. > I don't think it really is the symptom complained about here. Right now > "vacuumdb dbname --verbose" works (i.e. recognizes verbose as an > option), whereas "vacuumdb dbname --help" doesn't. The latter is what's > complained about here. And the reason for that is that > --help/-?/--version/-v aren't part of the getopt_long() call. Meh. I don't particularly object to including --help in the switch set recognized in getopt_long ... but I doubt that that will actually fix Alvaro's scenario. Note that we should not rip out the existing code, because part of the reason for that is that it acts before any of the other stuff that runs before getopt parsing starts, eg the postmaster's refusal to run if you're root. 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