Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvcJZ-00063Y-83 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:03:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvcJY-0006zB-NT for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 02:03:56 +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 1YvcJX-0006z4-MS for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:03:55 +0000 Received: from mail-qk0-f169.google.com ([209.85.220.169]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YvcJU-0003vy-Nl for pgsql-bugs@postgresql.org; Fri, 22 May 2015 02:03:54 +0000 Received: by qkgx75 with SMTP id x75so3402308qkg.1 for ; Thu, 21 May 2015 19:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ic+MaVHZWAtkJ2ZTQ7rSCz0+EZw8w+UXBhrZ/DIUGvE=; b=OyjVzqGQt7N1Z6grGxsreXqoEy0G8xTeN6f30CyFRMXAJhzxgzE8gMF61mbtkkPSvN mJwiqy/0idxyPCTOTuYku/NyBNHWL3oK49FUNiT8vDw5yuGUBhBT69zBN1zTXOzr4UTM 6wK8sJUDbEQ7RIT5s7NsMYS/V73bNQd3RoI+qZfVSTaLFu7aspwitdjivPzH2wOR21bS 2RxRxh1+ASM25z8UbPvgmoz4WqBjzwr858g84abYjmQympRcsv+MCaFBSBUVDfMPb5NN Ih8UVzj1RRd7QNYV+zqAMzQJY0c0rgfVei8xrNt/OI0/strdaPwMxIsuM1YA5mbOh4ak XOsg== X-Gm-Message-State: ALoCoQlNo1vDU10G5fJpVr9AenjFo++EYRt03QD7V10nXX/LAKSjoyaHEbBiSZNmHcOb+nw5our7 X-Received: by 10.140.132.80 with SMTP id 77mr8377654qhe.36.1432260231601; Thu, 21 May 2015 19:03:51 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([181.43.12.89]) by mx.google.com with ESMTPSA id 143sm460244qhw.21.2015.05.21.19.03.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 19:03:51 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 9B2D1541; Thu, 21 May 2015 22:58:11 -0300 (CLT) Date: Thu, 21 May 2015 22:58:11 -0300 From: Alvaro Herrera To: Tom Lane Cc: Michael Paquier , "D. S." , pgsql-bugs@postgresql.org Subject: Re: unrecognized option '--help Message-ID: <20150522015811.GR5885@postgresql.org> References: <1432193703.4099.3.camel@skuggor.se> <20150522013619.GQ5885@postgresql.org> <20213.1432259076@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20213.1432259076@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) 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 Tom Lane wrote: > Alvaro Herrera 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