OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / getopt.3
index 26794f4..0f05b5d 100644 (file)
@@ -38,7 +38,7 @@
 .\"            the start of optstring
 .\" Modified 2006-12-15, mtk, Added getopt() example program.
 .\"
-.TH GETOPT 3  2010-11-01 "GNU" "Linux Programmer's Manual"
+.TH GETOPT 3  2015-02-01 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getopt, getopt_long, getopt_long_only,
 optarg, optind, opterr, optopt \- Parse command-line options
@@ -244,8 +244,8 @@ specifies how results are returned for a long option.
 If \fIflag\fP
 is NULL, then
 .BR getopt_long ()
-returns \fIval\fP.  (For
-example, the calling program may set \fIval\fP to the equivalent short
+returns \fIval\fP.
+(For example, the calling program may set \fIval\fP to the equivalent short
 option character.)
 Otherwise,
 .BR getopt_long ()
@@ -374,6 +374,7 @@ The GNU
 implementation (and probably all other implementations) implements the
 correct behavior rather than that specified.
 .SH EXAMPLE
+.SS getopt()
 The following trivial example program uses
 .BR getopt ()
 to handle two program options:
@@ -412,7 +413,8 @@ main(int argc, char *argv[])
         }
     }
 
-    printf("flags=%d; tfnd=%d; optind=%d\\n", flags, tfnd, optind);
+    printf("flags=%d; tfnd=%d; nsecs=%d; optind=%d\\n",
+            flags, tfnd, nsecs, optind);
 
     if (optind >= argc) {
         fprintf(stderr, "Expected argument after options\\n");
@@ -426,7 +428,7 @@ main(int argc, char *argv[])
     exit(EXIT_SUCCESS);
 }
 .fi
-.PP
+.SS getopt_long()
 The following example program illustrates the use of
 .BR getopt_long ()
 with most of its features.
@@ -512,4 +514,14 @@ main(int argc, char **argv)
 }
 .fi
 .SH SEE ALSO
+.BR getopt (1),
 .BR getsubopt (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.