1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00

document that no leading whitespace is permitted between the option and

argument if the argument is deemed to be optional ('::').

feedback and ok jmc@ and millert@
This commit is contained in:
okan 2009-04-12 23:13:36 +00:00
parent 9dfc66bcdc
commit a4615ce8d8
2 changed files with 10 additions and 5 deletions

View File

@ -25,9 +25,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $OpenBSD: getopt.3,v 1.40 2007/05/31 19:19:31 jmc Exp $
.\" $OpenBSD: getopt.3,v 1.41 2009/04/12 23:13:36 okan Exp $
.\"
.Dd $Mdocdate: May 31 2007 $
.Dd $Mdocdate: April 12 2009 $
.Dt GETOPT 3
.Os
.Sh NAME
@ -73,7 +73,9 @@ recognizes an option and argument
.Fl x Ar argument .
It does not matter to
.Fn getopt
if a following argument has leading whitespace.
if a following argument has leading whitespace; except in the case where
the argument is optional, denoted with two colons, no leading whitespace
is permitted.
.Pp
On return from
.Fn getopt ,

View File

@ -1,9 +1,9 @@
.\" $OpenBSD: getopt.1,v 1.14 2007/05/31 19:20:10 jmc Exp $ -*- nroff -*-
.\" $OpenBSD: getopt.1,v 1.15 2009/04/12 23:13:36 okan Exp $ -*- nroff -*-
.\"
.\" This material, written by Henry Spencer, was released by him
.\" into the public domain and is thus not subject to any copyright.
.\"
.Dd $Mdocdate: May 31 2007 $
.Dd $Mdocdate: April 12 2009 $
.Dt GETOPT 1
.Os
.Sh NAME
@ -21,6 +21,9 @@ is a string of recognized option letters (see
if a letter is followed by a colon, the option
is expected to have an argument which may or may not be
separated from it by whitespace.
However, if a letter is followed by two colons, the argument is optional
and may not be separated by whitespace \- this is an extension not
covered by POSIX.
The special option
.Sq --
is used to delimit the end of the options.