Use standard section headers, suggested by jmc@openbsd. Sort sections.

This commit is contained in:
wiz 2003-09-10 13:30:16 +00:00
parent f03574d68b
commit 8d66b069c8
1 changed files with 34 additions and 34 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getopt.3,v 1.29 2003/09/10 09:35:41 wiz Exp $
.\" $NetBSD: getopt.3,v 1.30 2003/09/10 13:30:16 wiz Exp $
.\"
.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -157,39 +157,6 @@ is set to the character that caused the error.
The
.Fn getopt
function returns \-1 when the argument list is exhausted.
.Sh DIAGNOSTICS
If the
.Fn getopt
function encounters a character not found in the string
.Fa optstring
or detects
a missing option argument it writes an error message to
.Em stderr
and returns
.Sq \&? .
Setting
.Va opterr
to a zero will disable these error messages.
If
.Fa optstring
has a leading
.Sq \&:
then a missing option argument causes a
.Sq \&:
to be returned in addition to suppressing any error messages.
.Pp
Option arguments are allowed to begin with
.Sq - ;
this is reasonable but reduces the amount of error checking possible.
.Sh EXTENSIONS
The
.Va optreset
variable was added to make it possible to call the
.Fn getopt
function multiple times.
This is an extension to the
.St -p1003.2
specification.
.Sh EXAMPLES
.Bd -literal -compact
extern char *optarg;
@ -216,10 +183,43 @@ while ((ch = getopt(argc, argv, "bf:")) != -1)
argc -= optind;
argv += optind;
.Ed
.Sh DIAGNOSTICS
If the
.Fn getopt
function encounters a character not found in the string
.Fa optstring
or detects
a missing option argument it writes an error message to
.Em stderr
and returns
.Sq \&? .
Setting
.Va opterr
to a zero will disable these error messages.
If
.Fa optstring
has a leading
.Sq \&:
then a missing option argument causes a
.Sq \&:
to be returned in addition to suppressing any error messages.
.Pp
Option arguments are allowed to begin with
.Sq - ;
this is reasonable but reduces the amount of error checking possible.
.Sh SEE ALSO
.Xr getopt 1 ,
.Xr getopt_long 3 ,
.Xr getsubopt 3
.Sh STANDARDS
The
.Va optreset
variable was added to make it possible to call the
.Fn getopt
function multiple times.
This is an extension to the
.St -p1003.2
specification.
.Sh HISTORY
The
.Fn getopt