For maximum stability, Arg_parser is self-contained. It extracts all the information it needs from its arguments to avoid refering to them later. This avoids index-out-of-bounds errors.
Arg_parser does not modify its arguments, nor uses any global variables. So you may create more than one parser in your program if you need or want to.
The C++ version of Arg_parser can also parse options from configuration files.
To use Arg_parser in your own programs simply copy the files 'arg_parser.h' and 'arg_parser.cc' (or 'carg_parser.h' and 'carg_parser.c' for the C version) in your source tree. (These files have a link exception to the GPL, see below). See the file 'main.cc' ('cmain.c') for an example of use.
Arg_parser was developed as the argument parser for GNU moe, because moe's argument parsing is rather complex. (Then I used it in my other projects, including ddrescue, ed, lzip, and ocrad, with excellent results).
For general discussion of bugs in Arg_parser the mailing list arg-parser-bug@nongnu.org is the most appropriate forum. Please send messages as plain text. Please do not send messages encoded as HTML nor encoded as base64 MIME nor included as multiple formats. Please include a descriptive subject line. If all of the subject are "bug in arg_parser" it is impossible to differentiate them.
An archive of the bug report mailing list is available at http://lists.gnu.org/mailman/listinfo/arg-parser-bug.
See also the Arg_parser project page at Savannah.
As a special exception, you may use this free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this library, or you compile this library and link it with other files to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.
You are free to copy, modify and distribute all or part of this article without limitation.
Updated: 2013/02/24