summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/getopt.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.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.3')
-rw-r--r--src/lib/libc/stdlib/getopt.325
1 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3
index f261edcab7..0a28fa9e60 100644
--- a/src/lib/libc/stdlib/getopt.3
+++ b/src/lib/libc/stdlib/getopt.3
@@ -29,7 +29,7 @@
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.18 2002/12/04 20:31:30 millert Exp $ 32.\" $OpenBSD: getopt.3,v 1.19 2002/12/04 21:42:22 millert Exp $
33.\" 33.\"
34.Dd April 19, 1994 34.Dd April 19, 1994
35.Dt GETOPT 3 35.Dt GETOPT 3
@@ -126,6 +126,29 @@ When all options have been processed (i.e., up to the first non-option
126argument), 126argument),
127.Fn getopt 127.Fn getopt
128returns \-1. 128returns \-1.
129.Sh RETURN VALUES
130The
131.Fn getopt
132function returns the next known option character in
133.Fa optstring .
134If
135.Fn getopt
136encounters a character not found in
137.Fa optstring
138or if it detects a missing option argument,
139it returns
140.Sq ? .
141If
142.Fa optstring
143has a leading
144.Sq \:
145then a missing option argument causes
146.Sq \:
147to be returned instead of
148.Sq ? .
149The
150.Fn getopt
151function returns \-1 when the argument list is exhausted.
129.Sh EXAMPLES 152.Sh EXAMPLES
130.Bd -literal -compact 153.Bd -literal -compact
131int bflag, ch, fd; 154int bflag, ch, fd;