chiark / gitweb /
Version bump.
[mLib] / man / mdwopt.3
index daa2c8412ab3c3622bc7a53976c2608bc9d9f3ea..74dd15bcfa63b5ae7be984716a033afd90c52bfa 100644 (file)
@@ -1,5 +1,5 @@
 .\" -*-nroff-*-
-.TH mdwopt 3 "6 July 1999" mLib
+.TH mdwopt 3 "6 July 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH "NAME"
 mdwopt \- command-line option parser
 .\" @mdwopt
@@ -46,7 +46,7 @@ a
 is considered to be a non-option, since it usually represents standard
 input or output as a filename, and the word containing only a
 double-dash
-.RB ` \-\-'
+.RB ` \-\- '
 is used to mark all following words as being non-options regardless of
 their initial character.
 .PP
@@ -68,7 +68,7 @@ are a GNU convention.
 .SS "Short option syntax"
 Short options are the sort which Unix has known for ages: an option is a
 single letter, preceded by a
-.RB ` \-| '.
+.RB ` \- '.
 Short options can be joined together to save space (and possibly to make
 silly words): e.g., instead of giving options
 .RB ` "\-x \-y" ',
@@ -136,24 +136,24 @@ about the option in a data block.
 .PP
 The data block is a structure containing at least the following members:
 .TP
-.B arg
+.B "char *arg"
 Pointer to the argument of the current option, or null.  Argument
 strings persist for as long as the underlying command line argument
 array
 .I argv
 does, so it's usually safe just to remember the pointer.
 .TP
-.B opt
+.B "int opt"
 Value of the current option
 .TP
-.B int
+.B "int ind"
 Must be initialized to 0 before the first call to
 .BR mdwopt .
 After the last call, it is the index into
 .I argv
 of the first nonoption argument.
 .TP
-.B err
+.B "int err"
 Set to nonzero to allow
 .B mdwopt
 to emit error messages about illegal option syntax.  (This would be a
@@ -161,7 +161,7 @@ flag setting, but it has to be here for
 .B getopt
 compatibility.)
 .TP
-.B prog
+.B "char *prog"
 Contains the program's name, stripped of any path prefix.  This is an
 obsolete feature: the
 .BR quis (3)
@@ -173,7 +173,7 @@ the
 .B err
 and
 .B ind
-members of the structure must be initialized
+members of the structure must be initialized.
 .PP
 The arguments
 .I argc
@@ -258,16 +258,16 @@ table is of type
 .BR "struct option" ,
 which contains the following members (in order):
 .TP
-.B name
+.B "const char *name"
 Pointer to the option's name.
 .TP
-.B has_arg
+.B "int has_arg"
 A flags word describing the option.  (The name is historical.)
 .TP
-.B flag
+.B "int *flag"
 Address of the flag variable to use when this option is matched.
 .TP
-.B val
+.B "int val"
 Value to store or return when this option is matched.
 .PP
 The table is terminated by an entry whose
@@ -328,8 +328,9 @@ is returned by
 possibly with bit 8 set if the option was
 negated.
 .PP
-Arguments for long options are stored in the
+Arguments from long options are stored in the
 .B arg
+member of the data block.
 .SS "Other optional features"
 The
 .I flags