CLI is a domain-specific language (DSL) for defining command-line interfaces of C++ programs. It allows you to describe the options that your program supports, their types, and default values. For example:
include < string >;
class options
{
bool --help;
std::string --name = "example";
unsigned int --level | -l = 5;
};
CLI definitions are automatically translated to C++ classes using the CLI compiler. These classes implement parsing of the command line arguments and provide a convenient and type-safe interface for accessing the extracted data. For example:
int main (int argc, char* argv[])
{
options o (argc, argv);
if (o.help ())
print_usage ();
if (o.level () > 4)
cerr
Product's homepage