summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/getopt_long.330
1 files changed, 25 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.3 b/src/lib/libc/stdlib/getopt_long.3
index d6ce03f684..28a17bd8c0 100644
--- a/src/lib/libc/stdlib/getopt_long.3
+++ b/src/lib/libc/stdlib/getopt_long.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getopt_long.3,v 1.3 2002/12/05 21:02:19 millert Exp $ 1.\" $OpenBSD: getopt_long.3,v 1.4 2002/12/10 21:51:38 millert Exp $
2.\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $ 2.\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $
3.\" 3.\"
4.\" Copyright (c) 1988, 1991, 1993 4.\" Copyright (c) 1988, 1991, 1993
@@ -241,6 +241,27 @@ arguments to option '\e1'.
241honors POSIXLY_CORRECT and stops at the first non-option. 241honors POSIXLY_CORRECT and stops at the first non-option.
242.El 242.El
243.It Li o 243.It Li o
244handling of - within the option string (not the first character).
245.Bl -tag -width "OpenBSD"
246.It Li GNU
247treats a
248.Ql -
249on the command line as a non-argument.
250.It Li OpenBSD
251a
252.Ql -
253within the option string matches a
254.Ql -
255(single dash) on the command line.
256This functionality is provided for backward compatibility with
257programs, such as
258.Xr su 1 ,
259that use
260.Ql -
261as an option flag.
262This practice is wrong, and should not be used in any current development.
263.El
264.It Li o
244handling of :: in options string in presence of POSIXLY_CORRECT: 265handling of :: in options string in presence of POSIXLY_CORRECT:
245.Bl -tag -width "OpenBSD" 266.Bl -tag -width "OpenBSD"
246.It Li Both 267.It Li Both
@@ -280,10 +301,9 @@ handling of -W with W; in option string in getopt (not getopt_long):
280.It Li GNU 301.It Li GNU
281causes a segfault. 302causes a segfault.
282.It Li OpenBSD 303.It Li OpenBSD
283returns \-1, with optind pointing past the argument of -W 304no special handling is done;
284(as if `-W arg' were `--arg', and thus '--' had been found). 305.Dq W;
285.\" How should we treat W; in the option string when called via 306is interpreted as two separate options, neither of which take an argument.
286.\" getopt? Ignore the ';' or treat it as a ':'? Issue a warning?
287.El 307.El
288.It Li o 308.It Li o
289setting of optarg for long options without an argument that are 309setting of optarg for long options without an argument that are