Subject: Re: bug#7434: When an incorrect option is used before --help/--version, automake behaviour is inconsistent with that of other GNU programs.

From: Ralf Wildenhues <[email-masked]>
Date: Thu, 18 Nov 2010 21:26:16 +0100

Hello,

* Stefano Lattarini wrote on Thu, Nov 18, 2010 at 05:28:30PM CET:
> On Thursday 18 November 2010, Eric Blake wrote:
> > On 11/18/2010 08:22 AM, Stefano Lattarini wrote:
> > > Currently, automake and aclocal scan their command line looking for
> > > `--help' and `--version' even after an invalid option has been seen;
> > > and in case one of those two options is seen, it takes precedence
> > > even over error reporting about preceding invalid options.
> > 
> > GNU Coding Standards _only_ require that --help and --version be
> > recognized as the first argument, with no other arguments.
> > When possible, recognizing --help and --version after other arguments,
> > or with other arguments afterwards, is nice, but there are no rules
> > that require that consistency.

> Not exactly.  The GNU Coding Standards read (my emphasis):
> 
>   ``The standard --version option should direct the program to print
>     information about its name, version, origin and legal status, all
>     on standard output, and then exit successfully. Other options and
>     arguments should be ignored *once this is seen*, and the program
>     should not perform its normal function.''
> 
> So it means that the behaviour of GNU m4 (and the other mentioned
> programs) is compliant with the GCS, while the automake behaviour
> is "overzealous" in this respect.

I think the GCS should be adjusted then.  IIUC then GNU has valued
usability over implementation simplicity.  I think --help should work
whereever it is put on a command line, except after -- or right after an
option which requires an argument (or at least GCS should allow for this
behavior).  The point being that I type

$ foo --zork --barf
foo: blabla error, see --help

and then type <up><space>--help<enter> to find out more.

Let's address this on bug-standards before changing any programs.

Thanks,
Ralf