[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15483: POSIXLY_CORRECT documentation vis a vis some simple EREs
From: |
Eric Blake |
Subject: |
bug#15483: POSIXLY_CORRECT documentation vis a vis some simple EREs |
Date: |
Mon, 30 Sep 2013 11:32:07 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
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
Description: OpenPGP digital signature