Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvcSk-0006TF-Ff for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:13:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvcSj-0001Cj-TN for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:13:25 +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 1YvcSi-0001Cc-RK for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:13:24 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YvcSg-00048A-Ej for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:13:23 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 81443860001; Fri, 22 May 2015 04:13:21 +0200 (CEST) Date: Fri, 22 May 2015 04:13:19 +0200 From: Andres Freund To: Tom Lane Cc: Alvaro Herrera , Michael Paquier , "D. S." , pgsql-bugs@postgresql.org Subject: Re: unrecognized option '--help Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20675.1432259996@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) 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 On 2015-05-21 21:59:56 -0400, Tom Lane wrote: > As I recall, Alvaro's argument for this was "I typed multiple words of a > command and then want to check syntax, so I add --help to the end of what > I'd already typed and hit return, with the idea of recalling the command > and deleting the --help off the end so I don't have to retype what I > already entered." Something around that, yes. > 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. Sure, vacuumdb --dbname --help or something like that isn't going to work, but I think that's fairly minor in comparison to the above. And much easier to understand. > As I said, maybe that's okay. It'd certainly be 99.99% okay ... but > the other hundredth of a percent could be pretty painful. I can't see how treating it like the other options we already have could make it more painful? Greetings, Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs