Refer to new POSIX:2008 standard.
[gnulib.git] / doc / posix-functions / getopt.texi
1 @node getopt
2 @section @code{getopt}
3 @findex getopt
4
5 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getopt.html}
6
7 Gnulib module: ---
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @end itemize
12
13 Portability problems not fixed by Gnulib:
14 @itemize
15 @item
16 The default behavior of the glibc implementation of @code{getopt} allows
17 mixing option and non-option arguments on the command line in any order.
18 Other implementations, such as the one in Cygwin, enforce strict POSIX
19 compliance: they require that the option arguments precede the non-option
20 arguments.  This is something to watch out in your program's testsuite.
21 @end itemize
22
23 Gnulib provides a module @code{getopt} that has support for ``long options''.
24 Compared to POSIX, it adds a header file @code{<getopt.h>} and functions
25 @code{getopt_long} and @code{getopt_long_only}.