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.
[ Top of Page ]
Download
- Version 0.8.1 (20-Apr-2008, latest release):
- Source: opag-0.8.1.tar.gz (112 KB)
- Digital signature: opag-0.8.1.tar.gz.sig
- New in this version:
- A wrong optimization hint has been corrected. This fixes a crash if no header or code output file has been specified.
- Version 0.8.0 (08-May-2005):
- Source: opag-0.8.0.tar.gz (107 KB)
- Digital signature: opag-0.8.0.tar.gz.sig
- New in this version:
- From now on, I will sign releases. Information on how to obtain and verify my key is available on the contact information page.
- The preprocessing directives #if, #ifdef and #endif can be used in the definition section of the input file. They are put around the parsing code for the corresponding options, so that code which recognizes some options conditionally can be generated.
Debian packages (i386, amd64, source) are also available.
[ Top of Page ]
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.
![]()
[ Top of Page ]