Ya_getopt is a drop-in replacement of GNU C library getopt.
getopt()
, getopt_long()
and getopt_long_only()
are implemented excluding the following GNU extension features.
-
If optstring contains W followed by a semicolon, then -W foo is treated as the long option --foo.
-
_<PID>_GNU_nonoption_argv_flags_
The license is 2-clause BSD-style license. You can use the Linux getopt compatible function under Windows, Solaris and so on without having to worry about license issue.
Don't send me a patch if you have looked at GNU C library getopt source code. That's because I made this with clean room design to avoid the influence of the GNU LGPL.
Please make a test script passed by the GNU C library getopt but not by ya_getopt instead.
2-clause BSD-style license
- public domain AT&T getopt public domain, no getopt_long, no getopt_long_only, no argv permutation
- Free Getopt 3-clause BSD-style licence, no getopt_long, no getopt_long_only
- getopt_port 3-clause BSD-style licence, no getopt_long_only, no argv permutation
- XGetopt - A Unix-compatible getopt() for MFC and Win32
- Full getopt Port for Unicode and Multibyte Microsoft Visual C, C++, or MFC Projects LGPL