bug-standards
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: program --help behavior


From: Karl Berry
Subject: Re: program --help behavior
Date: Sat, 20 Nov 2010 23:52:56 GMT

    > 1) allowed by the GCS to produce --help output,

Certainly.  There is nothing in the coding standards that forbids it.

    > 2) required by the GCS to produce --help output.

Certainly not.  There is nothing in the coding standards that requires it.

In other words, you can make --help and --version work after invalid
options if you want to.  But you don't have to.  Either way is ok.

    http://debbugs.gnu.org/7434

And yes, as pointed out by Stefano, the result of this non-specification
is that different programs may behave differently wrt invalid options
and --help/--version.  This doesn't seem like a problem to me, because
neither interpretation seems obviously better/less "surprising" to me.
If this isn't good enough and you want me to get rms's opinion on the
matter, let me know.

Eric, in that thread you wrote that it's only required to support them
when they are the first argument.  I seem to remember seeing that as
well at some point, but I do not find anything in the current text that
says it.  The only general statement I can find is in the Command-Line
Interfaces node, which says simply:

   All programs should support two standard options:
   `--version' and `--help'.

Exactly what "support" means is left unstated.

It is certainly true that many non-GNU programs only support --help and
--version when they are the first (and possibly only) argument.  I've
done that myself with many TeX-world programs for various reasons.  I
wouldn't be surprised if some GNU programs only support that as well.

Personally, I think it's desirable to support --help and --version if
they appear anywhere on a valid command line.  I have no opinion on what
to do with an invalid command line.

karl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]