GNU bug report logs -
#15483
POSIXLY_CORRECT documentation vis a vis some simple EREs
Previous Next
Reported by: gdg <at> zplane.com
Date: Sat, 28 Sep 2013 18:24:09 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #34 received at 15483 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 09/30/2013 08:21 AM, Eric Blake wrote:
> Case in point: have you ever typed 'grep --help' to see what grep can
> do, or 'grep --version' to see what build you are using? Well, such a
> command line is not permissible of a strictly conforming use of grep
> (ie. POSIX states that it is undefined behavior to pass a command line
> argument that has a length larger than 2 and which starts with two
> dashes).
Since we're playing the role of pedantry here, let me amend that:
POSIX states that it is undefined behavior to pass a command line
argument that has a length larger than 2 and which starts with two
dashes, IFF you did not first pass the '--' end-of-options argument.
(The behavior of 'grep -- --help' is well-defined: search for lines of
stdin that match the regular expression "--help".)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 11 years and 315 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.