pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: src/port/getopt_long.c lossy with arguments having no option characters
Date: Fri, 3 Apr 2015 19:06:38 -0300
Message-ID: <20150403220638.GA4369@alvh.no-ip.org> (raw)
In-Reply-To: <551EEE5A.10709@gmx.net>
References: <CAB7nPqQ45JbD1ZBvbD7gqQK4diGZXmGw56zp7R_DvEKO8EdMbQ@mail.gmail.com>
	<28931.1428070107@sss.pgh.pa.us>
	<551EEE5A.10709@gmx.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Peter Eisentraut wrote:
> On 4/3/15 10:08 AM, Tom Lane wrote:
> > Michael Paquier <michael.paquier@gmail.com> writes:
> >> The implementation of getopt_long in src/port has some limitations,
> >> for example such commands do not work but they should:
> > 
> > No, those should not work.  You're too used to versions that don't insist
> > on switches-before-non-switch-arguments.  Such behavior is an extension
> > that is not standard,
> 
> It is true that options after non-option arguments are a GNU extension,
> but long options are also a GNU extension.  So the behavior we provide
> is neither pure POSIX nor pure GNU.  I can see how that would be confusing.

The thing I hate the most about this issue is how some commands fail
with "--help: unrecognized option" or some such, when called as

command --foo=bar --baz --help

I am used to such calls to emit the help, then exit, and the command is
kept in history; that way, it's easy to adjust for the info found in the
help and edit later.  As is, I tend to esc-# to save the commented-out
command in history, then call with only --help, then recall the
commented-out version.

-- 
Á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



view thread (10+ messages)  latest in thread

Message-ID: <20150403220638.GA4369@alvh.no-ip.org>
Permalink:  ../20150403220638.GA4369@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20150403220638.GA4369@alvh.no-ip.org

 · 

reply

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: alvherre@2ndquadrant.com, peter_e@gmx.net, tgl@sss.pgh.pa.us, michael.paquier@gmail.com
  Subject: Re: src/port/getopt_long.c lossy with arguments having no option characters
  In-Reply-To: <20150403220638.GA4369@alvh.no-ip.org>
  References: <CAB7nPqQ45JbD1ZBvbD7gqQK4diGZXmGw56zp7R_DvEKO8EdMbQ@mail.gmail.com> <28931.1428070107@sss.pgh.pa.us> <551EEE5A.10709@gmx.net> <20150403220638.GA4369@alvh.no-ip.org>

* 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