Opag

Option Parser Generator

What is it?

‘Opag’, which stands for ‘Option Parser Generator’, is a program to generate C or C++ code which parses command line options. It takes as input a description of the command line options you want your program to support. The output is a C or C++ function which finds these options in an array of strings (typically argv, the second parameter of the main function) and sets variables accordingly. Short (single character) as well as long (GNU style) options are supported.

It is also possbile to associate a help string with each option. Opag uses these to create a macro which expands to a string containing a nicely formatted description of the options.

Opag is *-> Free Software, released under the GNU General Public License.

Download

Debian packages (i386, amd64, source) are also available.

Bug Reporting

Bug reports should be mailed to <martin@zero-based.org>. Please include all relevant information. If opag fails to build, you should include the file config.log, which is created during configuration of the package. If opag crashes or behaves incorrectly at run time, please state the exact command you have used to invoke it, and include the input file.

Of course, you can also suggest new features you would like to have, or just tell me what you think of opag. :-)