Deleted Added
full compact
getopt_long.3 (126439) getopt_long.3 (126440)
1.\" $OpenBSD: getopt_long.3,v 1.10 2004/01/06 23:44:28 fgsch Exp $
2.\" $NetBSD: getopt_long.3,v 1.14 2003/08/07 16:43:40 agc Exp $
3.\"
4.\" Copyright (c) 1988, 1991, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" @(#)getopt.3 8.5 (Berkeley) 4/27/95
1.\" $OpenBSD: getopt_long.3,v 1.10 2004/01/06 23:44:28 fgsch Exp $
2.\" $NetBSD: getopt_long.3,v 1.14 2003/08/07 16:43:40 agc Exp $
3.\"
4.\" Copyright (c) 1988, 1991, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" @(#)getopt.3 8.5 (Berkeley) 4/27/95
32.\" $FreeBSD: head/lib/libc/stdlib/getopt_long.3 126439 2004-03-01 10:12:45Z ache $
32.\" $FreeBSD: head/lib/libc/stdlib/getopt_long.3 126440 2004-03-01 10:59:23Z ache $
33.\"
34.Dd April 1, 2000
35.Dt GETOPT_LONG 3
36.Os
37.Sh NAME
38.Nm getopt_long ,
39.Nm getopt_long_only
40.Nd get long options from command line argument list

--- 285 unchanged lines hidden (view full) ---

326.It Bx
327returns
328.Ql \&:
329(since
330.Bx Ns 's
331.Fn getopt
332does).
333.El
33.\"
34.Dd April 1, 2000
35.Dt GETOPT_LONG 3
36.Os
37.Sh NAME
38.Nm getopt_long ,
39.Nm getopt_long_only
40.Nd get long options from command line argument list

--- 285 unchanged lines hidden (view full) ---

326.It Bx
327returns
328.Ql \&:
329(since
330.Bx Ns 's
331.Fn getopt
332does).
333.El
334.\" .It
335.\" Handling of
336.\" .Ql --a
337.\" in getopt:
338.\" .Bl -tag -width ".Bx"
339.\" .It Tn GNU
340.\" parses this as option
341.\" .Ql - ,
342.\" option
343.\" .Ql a .
344.\" .It Bx
345.\" parses this as
346.\" .Ql -- ,
347.\" and returns \-1 (ignoring the
348.\" .Ql a ) .
349.\" (Because the original
350.\" .Fn getopt
351.\" does.)
352.\" .El
334.It
353.It
335Handling of
336.Ql --a
337in getopt:
338.Bl -tag -width ".Bx"
339.It Tn GNU
340parses this as option
341.Ql - ,
342option
343.Ql a .
344.It Bx
345parses this as
346.Ql -- ,
347and returns \-1 (ignoring the
348.Ql a ) .
349(Because the original
350.Fn getopt
351does.)
352.El
353.It
354Setting of
355.Va optopt
356for long options with
357.Va flag
358!=
359.Dv NULL :
360.Bl -tag -width ".Bx"
361.It Tn GNU
362sets
363.Va optopt
364to
365.Va val .
366.It Bx
367sets
368.Va optopt
369to 0 (since
370.Va val
371would never be returned).
372.El
354Setting of
355.Va optopt
356for long options with
357.Va flag
358!=
359.Dv NULL :
360.Bl -tag -width ".Bx"
361.It Tn GNU
362sets
363.Va optopt
364to
365.Va val .
366.It Bx
367sets
368.Va optopt
369to 0 (since
370.Va val
371would never be returned).
372.El
373.\" .It
374.\" Handling of
375.\" .Ql -W
376.\" with
377.\" .Ql W;
378.\" in option string in
379.\" .Fn getopt
380.\" (not
381.\" .Fn getopt_long ) :
382.\" .Bl -tag -width ".Bx"
383.\" .It Tn GNU
384.\" causes a segfault.
385.\" .It Bx
386.\" no special handling is done;
387.\" .Ql W;
388.\" is interpreted as two separate options, neither of which take an argument.
389.\" .El
373.It
390.It
374Handling of
375.Ql -W
376with
377.Ql W;
378in option string in
379.Fn getopt
380(not
381.Fn getopt_long ) :
382.Bl -tag -width ".Bx"
383.It Tn GNU
384causes a segfault.
385.It Bx
386no special handling is done;
387.Ql W;
388is interpreted as two separate options, neither of which take an argument.
389.El
390.It
391Setting of
392.Va optarg
393for long options without an argument that are
394invoked via
395.Ql -W
396.Ql ( W;
397in option string):
398.Bl -tag -width ".Bx"

--- 108 unchanged lines hidden ---
391Setting of
392.Va optarg
393for long options without an argument that are
394invoked via
395.Ql -W
396.Ql ( W;
397in option string):
398.Bl -tag -width ".Bx"

--- 108 unchanged lines hidden ---