Archive for December, 2009

CLI 1.1.0 released

Tuesday, December 15th, 2009

CLI 1.1.0 is now available from the project’s web page. The automatic usage and documentation generation is by far the biggest new feature in this release. The usage information is nicely formatted during compilation and the documentation can be generated in the HTML and man page formats. For an example of the HTML output, see the CLI Compiler Command Line Manual. You may also want to check the cli.1 man page and the usage information printed by the CLI compiler. For more information on this feature see Section 3.3, “Option Documentation” in the Getting Started Guide.

Other new features in this release are the optional generation of modifiers in addition to accessors, support for erasing the parsed elements from the argv array, and the new scanner interface. The scanner allows one to supply command line arguments from custom sources. It has the following interface:

namespace cli
  class scanner
    virtual bool
    more () = 0;
    virtual const char*
    peek () = 0;
    virtual const char*
    next () = 0;
    virtual void
    skip () = 0;

The two standard scanner implementations provided by CLI are argv_scanner and argv_file_scanner. The first implementation is a simple scanner for the argv array. The argv_file_scanner implementation provides support for reading command line arguments from the argv array as well as files specified with command line options. Also, the generated option classes now have a new constructor which accepts the abstract scanner interface. For more information in this feature see Section 3.1, “Option Class Definition” in the Getting Started Guide.

For a more detailed list of new features and changes in this release see the NEWS file inside the CLI source distribution or the announcement on the cli-users mailing list.