summaryrefslogtreecommitdiff
path: root/usr.bin/getopt
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2006-01-14 09:37:25 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2006-01-14 09:37:25 +0000
commita0d24ebfe6138fa09ec845c7eab8a0ae2434f1bf (patch)
treef1e4a8de62aacd59a40c387727004a42d624414c /usr.bin/getopt
parentba0a79daaad7a2a9fe8d5e6890863d1f2f3fef2e (diff)
document why we avoid: set -- `getopt optstring $*`
Diffstat (limited to 'usr.bin/getopt')
-rw-r--r--usr.bin/getopt/getopt.111
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/getopt/getopt.1 b/usr.bin/getopt/getopt.1
index 51763c22840..1b1ea8c4ea4 100644
--- a/usr.bin/getopt/getopt.1
+++ b/usr.bin/getopt/getopt.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getopt.1,v 1.10 2006/01/14 09:29:51 jmc Exp $ -*- nroff -*-
+.\" $OpenBSD: getopt.1,v 1.11 2006/01/14 09:37:24 jmc Exp $ -*- nroff -*-
.\"
.\" This material, written by Henry Spencer, was released by him
.\" into the public domain and is thus not subject to any copyright.
@@ -36,6 +36,15 @@ preceded by a
.Sq -
and in its own shell argument;
each option argument is also in its own shell argument.
+.Pp
+Note that the construction
+.Cm set -- `getopt optstring $*`
+is not recommended,
+as the exit value from
+.Dq set
+will prevent the exit value from
+.Nm
+from being determined.
.Sh EXAMPLES
The following code fragment shows how one might process the arguments
for a command that can take the options