Make clear that when calling getopt_long() and there are no

short options, then 'optstring' should be "" not NULL.
This commit is contained in:
Michael Kerrisk 2006-01-16 22:48:21 +00:00
parent 660dd25fee
commit d0ac4fb3e2
1 changed files with 4 additions and 1 deletions

View File

@ -145,6 +145,9 @@ The
function works like
.BR getopt ()
except that it also accepts long options, started out by two dashes.
(If the program accepts only long options, then
.I optstring
should be specified as an empty string (""), not NULL.)
Long option names may be abbreviated if the abbreviation is
unique or is an exact match for some defined option. A long option
may take a parameter, of the form
@ -226,7 +229,7 @@ if it is ':', then ':' is returned; otherwise '?' is returned.
\fBgetopt_long\fP() and \fBgetopt_long_only\fP() also return the option
character when a short option is recognized. For a long option, they
return \fIval\fP if \fIflag\fP is NULL, and 0 otherwise. Error
and \-1 returns are the same as for \fBgetopt\fP() (), plus '?' for an
and \-1 returns are the same as for \fBgetopt\fP(), plus '?' for an
ambiguous match or an extraneous parameter.
.SH "ENVIRONMENT VARIABLES"
.TP