summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/getopt_long.3
diff options
context:
space:
mode:
authormillert <>2002-12-04 21:42:22 +0000
committermillert <>2002-12-04 21:42:22 +0000
commit125f2e644410c74d46afb021cca115828c53f63c (patch)
treea3568a949893a99e4c00c1365b789d23bbdd8c9c /src/lib/libc/stdlib/getopt_long.3
parent63233cae569fa052ad6aebc01a0b09722aa183be (diff)
downloadopenbsd-125f2e644410c74d46afb021cca115828c53f63c.tar.gz
openbsd-125f2e644410c74d46afb021cca115828c53f63c.tar.bz2
openbsd-125f2e644410c74d46afb021cca115828c53f63c.zip
Add "RETURN VALUES" sections
Diffstat (limited to 'src/lib/libc/stdlib/getopt_long.3')
-rw-r--r--src/lib/libc/stdlib/getopt_long.329
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.3 b/src/lib/libc/stdlib/getopt_long.3
index d55f4ead53..cfbe255e6c 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.1 2002/12/03 20:24:30 millert Exp $ 1.\" $OpenBSD: getopt_long.3,v 1.2 2002/12/04 21:42:22 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
@@ -163,6 +163,33 @@ If an option starting with
163.Sq - 163.Sq -
164does not match a long option but does match a single-character option, 164does not match a long option but does match a single-character option,
165the single-character option is returned. 165the single-character option is returned.
166.Sh RETURN VALUES
167If the
168.Fa flag
169field in
170.Li struct option
171is
172.Dv NULL ,
173.Fn getopt_long
174and
175.Fn getopt_long_only
176return the value specified in the
177.Fa val
178field, which is usually just the corresponding short option.
179If
180.Fa flag
181is not
182.Dv NULL ,
183these functions return 0 and store
184.Fa val
185in the location pointed to by
186.Fa flag .
187These functions return
188.Sq \:
189if there was a missing option argument,
190.Sq ?
191if the user specified an unknown or ambiguous option, and
192\-1 when the argument list has been exhausted.
166.Sh EXAMPLES 193.Sh EXAMPLES
167.Bd -literal -compact 194.Bd -literal -compact
168int bflag, ch, fd; 195int bflag, ch, fd;