Package: manpages-dev Version: 3.35-0.1 Severity: normal Tags: patch File: /usr/share/man/man3/getopt.3.gz
The following corrects a bad example in the manual page. It also emphasizes the issue. See, for example, #655685, which was filed for procps. --- a/getopt.3 2012-03-06 11:33:58.252003620 +0200 +++ b/getopt.3 2012-03-06 11:33:36.000000000 +0200 @@ -371,14 +371,28 @@ has a technical error described in POSIX The GNU implementation (and probably all other implementations) implements the correct behavior rather than that specified. +.PP +There should be no white space between a short option name +and its possible arguments. +That is, use +.IR -unsecs +, not +.IR "-u nsecs" . +With long options, use =, with no space characters either before or +after it. That is, +.IR --units=nsecs +, nothing else. .SH EXAMPLE The following trivial example program uses .BR getopt () to handle two program options: .IR \-n , with no associated value; and -.IR "\-t val" , +.IR "\-tval" , which expects an associated value. +Note that +.IR "\-t val" , +with a space, does not work. .nf .sp #include <unistd.h> -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

