lock tests: Fix link error on HP-UX/hppa (regression from 2019-12-21).
[gnulib.git] / doc / glibc-functions / getopt_long_only.texi
bloba52696a0de82470c82c33df6bfa1a56fa617bcc9
1 @node getopt_long_only
2 @subsection @code{getopt_long_only}
3 @findex getopt_long_only
5 Documentation:
6 @itemize
7 @item
8 @ifinfo
9 @ref{Getopt Long Options,,Parsing Long Options with getopt_long,libc},
10 @end ifinfo
11 @ifnotinfo
12 @url{https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html},
13 @end ifnotinfo
14 @item
15 @uref{https://www.kernel.org/doc/man-pages/online/pages/man3/getopt_long_only.3.html,,man getopt_long_only}.
16 @end itemize
18 Gnulib module: getopt-gnu
20 Portability problems fixed by Gnulib:
21 @itemize
22 @item
23 The function @code{getopt_long_only} does not obey the combination of
24 @samp{+} and @samp{:} flags in the options string on some platforms:
25 glibc 2.11.
26 @item
27 The use of @samp{W;} in the optstring argument to does not always
28 allow @code{-W foo} to behave synonymously with @code{--foo}:
29 glibc 2.11.
30 @item
31 The function @code{getopt_long_only} does not support the @samp{+}
32 flag in the options string on some platforms:
33 Mac OS X 10.5, AIX 5.2, Solaris 10.
34 @item
35 The value of @code{optind} after a missing required argument is wrong
36 on some platforms:
37 Mac OS X 10.5.
38 @item
39 The function @code{getopt_long_only} does not obey the @samp{-} flag
40 in the options string when @env{POSIXLY_CORRECT} is set on some platforms:
41 Cygwin 1.7.0.
42 @item
43 Some implementations fail to reset state, including re-checking
44 @env{POSIXLY_CORRECT}, when @code{optind} is set to @samp{0}:
45 NetBSD, Cygwin 1.7.0.
46 @item
47 The function @code{getopt_long_only} does not support options with
48 optional arguments on some platforms:
49 Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, Solaris 11 2010-11, Cygwin 1.5.x.
50 @item
51 This function is missing on some platforms:
52 FreeBSD 5.2.1, NetBSD 5.0, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, mingw, MSVC 14.
53 @item
54 This function crashes if the option string includes @code{W;} but
55 there are no long options, on some platforms:
56 glibc 2.14.
57 @end itemize
59 Portability problems not fixed by Gnulib:
60 @itemize
61 @item
62 Some implementations return success instead of reporting an ambiguity
63 if user's option is a prefix of two long options with the same outcome:
64 FreeBSD.
65 @item
66 The GNU Coding Standards discourage the use of @code{getopt_long_only}
67 in new programs.
68 @end itemize