summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2003-09-18 09:29:27 +0000
committerjmc <>2003-09-18 09:29:27 +0000
commit1328054b5f2318ebbd1b4dec83ddf08b1f17777d (patch)
treef6639a2fdfa9f64f9ca89afaf8cb70bb14443c4f
parent4839ac8dc0d4f903aa90bf5c373015aa7fa0d569 (diff)
downloadopenbsd-1328054b5f2318ebbd1b4dec83ddf08b1f17777d.tar.gz
openbsd-1328054b5f2318ebbd1b4dec83ddf08b1f17777d.tar.bz2
openbsd-1328054b5f2318ebbd1b4dec83ddf08b1f17777d.zip
typos from wiz@netbsd (including one from a PR from Quentin Garnier);
slight sync with NetBSD page; ok millert@
-rw-r--r--src/lib/libc/stdlib/getopt.324
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3
index 9b27b70e65..50b756bfbb 100644
--- a/src/lib/libc/stdlib/getopt.3
+++ b/src/lib/libc/stdlib/getopt.3
@@ -25,7 +25,7 @@
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE. 26.\" SUCH DAMAGE.
27.\" 27.\"
28.\" $OpenBSD: getopt.3,v 1.26 2003/09/02 18:24:21 jmc Exp $ 28.\" $OpenBSD: getopt.3,v 1.27 2003/09/18 09:29:27 jmc Exp $
29.\" 29.\"
30.Dd December 17, 2002 30.Dd December 17, 2002
31.Dt GETOPT 3 31.Dt GETOPT 3
@@ -47,9 +47,11 @@ The
47.Fn getopt 47.Fn getopt
48function incrementally parses a command line argument list 48function incrementally parses a command line argument list
49.Fa argv 49.Fa argv
50and returns the next known option character. 50and returns the next
51.Em known
52option character.
51An option character is 53An option character is
52.Dq known 54.Em known
53if it has been specified in the string of accepted option characters, 55if it has been specified in the string of accepted option characters,
54.Fa optstring . 56.Fa optstring .
55.Pp 57.Pp
@@ -113,7 +115,7 @@ by the option
113.Ql -- 115.Ql --
114(double dash) which causes 116(double dash) which causes
115.Fn getopt 117.Fn getopt
116to signal the end of argument processing and returns \-1. 118to signal the end of argument processing and return \-1.
117When all options have been processed (i.e., up to the first non-option 119When all options have been processed (i.e., up to the first non-option
118argument), 120argument),
119.Fn getopt 121.Fn getopt
@@ -134,9 +136,9 @@ it returns
134If 136If
135.Fa optstring 137.Fa optstring
136has a leading 138has a leading
137.Sq \: 139.Sq \&:
138then a missing option argument causes 140then a missing option argument causes
139.Sq \: 141.Sq \&:
140to be returned instead of 142to be returned instead of
141.Sq \&? . 143.Sq \&? .
142In either case, the variable 144In either case, the variable
@@ -147,6 +149,8 @@ The
147function returns \-1 when the argument list is exhausted. 149function returns \-1 when the argument list is exhausted.
148.Sh EXAMPLES 150.Sh EXAMPLES
149.Bd -literal -compact 151.Bd -literal -compact
152extern char *optarg;
153extern int optind;
150int bflag, ch, fd; 154int bflag, ch, fd;
151 155
152bflag = 0; 156bflag = 0;
@@ -174,7 +178,7 @@ argv += optind;
174If the 178If the
175.Fn getopt 179.Fn getopt
176function encounters a character not found in the string 180function encounters a character not found in the string
177.Va optstring 181.Fa optstring
178or detects 182or detects
179a missing option argument it writes an error message to 183a missing option argument it writes an error message to
180.Em stderr 184.Em stderr
@@ -184,7 +188,7 @@ Setting
184.Va opterr 188.Va opterr
185to a zero will disable these error messages. 189to a zero will disable these error messages.
186If 190If
187.Va optstring 191.Fa optstring
188has a leading 192has a leading
189.Ql \&: 193.Ql \&:
190then a missing option argument causes a 194then a missing option argument causes a
@@ -198,7 +202,7 @@ this is reasonable but reduces the amount of error checking possible.
198.Xr getopt 1 , 202.Xr getopt 1 ,
199.Xr getopt_long 3 , 203.Xr getopt_long 3 ,
200.Xr getsubopt 3 204.Xr getsubopt 3
201.Sh EXTENSIONS 205.Sh STANDARDS
202The 206The
203.Va optreset 207.Va optreset
204variable was added to make it possible to call the 208variable was added to make it possible to call the
@@ -223,7 +227,7 @@ This was changed by
223to decouple 227to decouple
224.Fn getopt 228.Fn getopt
225from 229from
226.Pa <stdio.h> . 230.Aq Pa stdio.h .
227.Pp 231.Pp
228A single dash 232A single dash
229.Pq Ql - 233.Pq Ql -