summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libc/stdlib/getopt.314
-rw-r--r--src/lib/libc/stdlib/getopt_long.35
2 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3
index ce85f678df..d7d69cf15b 100644
--- a/src/lib/libc/stdlib/getopt.3
+++ b/src/lib/libc/stdlib/getopt.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: getopt.3,v 1.23 2003/06/01 19:27:27 jmc Exp $ 32.\" $OpenBSD: getopt.3,v 1.24 2003/06/02 03:49:39 millert Exp $
33.\" 33.\"
34.Dd December 8, 2002 34.Dd December 17, 2002
35.Dt GETOPT 3 35.Dt GETOPT 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -85,10 +85,6 @@ contains the index to the next
85argument for a subsequent call 85argument for a subsequent call
86to 86to
87.Fn getopt . 87.Fn getopt .
88The variable
89.Va optopt
90saves the last known option character returned by
91.Fn getopt .
92.Pp 88.Pp
93The variables 89The variables
94.Va opterr 90.Va opterr
@@ -137,7 +133,8 @@ encounters a character not found in
137.Fa optstring 133.Fa optstring
138or if it detects a missing option argument, 134or if it detects a missing option argument,
139it returns 135it returns
140.Sq ? . 136.Sq ?
137(question mark).
141If 138If
142.Fa optstring 139.Fa optstring
143has a leading 140has a leading
@@ -146,6 +143,9 @@ then a missing option argument causes
146.Sq \: 143.Sq \:
147to be returned instead of 144to be returned instead of
148.Sq ? . 145.Sq ? .
146In either case, the variable
147.Va optopt
148is set to the character that caused the error.
149The 149The
150.Fn getopt 150.Fn getopt
151function returns \-1 when the argument list is exhausted. 151function returns \-1 when the argument list is exhausted.
diff --git a/src/lib/libc/stdlib/getopt_long.3 b/src/lib/libc/stdlib/getopt_long.3
index 2589bd7b03..f69f72d908 100644
--- a/src/lib/libc/stdlib/getopt_long.3
+++ b/src/lib/libc/stdlib/getopt_long.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getopt_long.3,v 1.6 2003/05/10 06:48:30 jmc Exp $ 1.\" $OpenBSD: getopt_long.3,v 1.7 2003/06/02 03:49:39 millert Exp $
2.\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $ 2.\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $
3.\" 3.\"
4.\" Copyright (c) 1988, 1991, 1993 4.\" Copyright (c) 1988, 1991, 1993
@@ -368,6 +368,3 @@ argument is not really
368as its elements may be permuted (unless 368as its elements may be permuted (unless
369.Ev POSIXLY_CORRECT 369.Ev POSIXLY_CORRECT
370is set). 370is set).
371.Pp
372In a future release, this implementation should completely replace
373.Xr getopt 3 .