Automated Argument Helper 1.2.2

Aargh is a code generator, written in C++ and licensed under the terms of the GNU General Public License (GPL).
Aargh is a code generator, written in C++ and licensed under the terms of the GNU General Public License (GPL). It generates C++ code to parse a command line, using the getopt() facility available in UNIX and UNIX-like environments.

Automated Argument Helper project supports command-line options with integer arguments, string arguments, and no arguments. The generated code is commented and carefully indented for readability.

It's nice to have lots of command line options, but it's a real pain to code for them.
Not that it's difficult. It's just tedious, time-consuming, error prone, and no fun. I used to wince at the thought of adding command line options.

Not any more. All I have to do is define the options I want in a small XML file, and run it through aargh. Instantly I have C++ source code that I can compile and link into my program.

If I need to add another option, or otherwise change the rules, I can edit the XML and regenerate the code. No muss, no fuss. Now I can spend more time on the interesting parts of the project.

To use aargh, write an XML file to describe the options you want. When aargh reads the file, it generates two C++ files.

One file is a header that declares a class to represent the options. By default this class is named "Opts," but you can specify a different name. The other file is the implementation of Opts, or whatever you decide to call it. The Opts class provides member functions to parse the command line and return the results.

In your own code, declare an instance of Opts and call Opts::get() to parse the command line, passing it the argc and argv arguments from main(). Opts::get() returns zero if the command line follows the rules that you have outlined in the XML file, or non-zero otherwise. If the parsing is successful, the Opts object stores the results and makes them available to your program by a series of accessor functions.

Here are some key features of "Automated Argument Helper":

· You can enforce upper and/or lower limits on the number of non-option arguments.
· You can distinguish between options that take arguments and those that don't.
· You can specify that an option is required.
· You can require that the argument to an option be a non-negative integer.
· For an integer argument you can enforce upper and/or lower limits.
· For a string argument you can enforce upper and/or lower limits on the string length.
· For a string argument you can call a function of your own to validate the argument.
· You can allow multiple occurrences of the same option. In that case the generated code builds an STL vector to hold the arguments. By default the generated software allows only one occurrence of any given option.

What's New in This Release:

· You can now specify the location of the generated header file independently of its name.
· This feature may make it easier to incorporate aargh into complex build environments.

last updated on:
April 14th, 2006, 19:52 GMT
license type:
GPL (GNU General Public License) 
developed by:
Scott McKellar
ROOT \ Programming \ Code Generators
Automated Argument Helper
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!

Add your review!