Date: Fri, 27 Mar 2009 12:26:36 +0300 (MSK) From: "Oleg A. Mamontov" <oleg@mamontov.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/133118: Error in getopt (1) manual EXAMPLES section Message-ID: <200903270926.n2R9Qa2f086442@dev2.rambler.ru> Resent-Message-ID: <200903270930.n2R9U3EG091535@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 133118
>Category: docs
>Synopsis: Error in getopt (1) manual EXAMPLES section
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Mar 27 09:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Oleg A. Mamontov
>Release: FreeBSD 7.0-20080303-SNAP amd64
>Organization:
Rambler Internet Holding
>Environment:
System: FreeBSD dev2.rambler.ru 7.0-20080303-SNAP FreeBSD 7.0-20080303-SNAP #1: Tue Apr 8 13:54:52 MSD 2008 root@dev2.rambler.ru:/usr/src/sys/amd64/compile/DEV2 amd64
>Description:
The man page for getopt(1) contains incorrect example.
for i
do
case "$i"
in
...
done
Variable $@ expanded to list of options and their values (if any).
Loop variable ($i) will contain both (but should contain only options).
This invalid example was imported from NetBSD cvs in Revision 1.1:
http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/getopt/getopt.1?rev=1.1;content-type=text%2Fx-cvsweb-markup
Later this was fixed in NetBSD:
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/getopt/getopt.1?rev=1.10&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
>How-To-Repeat:
>Fix:
This piece of code should look like this:
while true;
do
case "$1"
in
...
done
>Release-Note:
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903270926.n2R9Qa2f086442>
