|
RADLib
RADical C++ application framework
|
RADCLI provides command-line parsing and application utility helpers for RADLib tools and examples.
RADCLI::CommandLineParser is the core type. It is constructed with an application name, takes an optional description via setDescription(), and accepts option definitions through addOption(). Each RADCLI::Option declares a long name, an optional shortName, description, and the requiresValue, required, and defaultValue fields that control validation and defaults. parse() accepts either argc/argv or a std::vector<std::string> (where args[0] is the program name), and helpText() builds formatted usage text from the registered options.
Parsing yields a RADCLI::ParseResult. Call ok() and error() to check for failures, has() to test whether an option was explicitly provided, value() to read an option value or its default, and positionals() to read the remaining positional arguments.
RADCLI also exposes free-function application helpers: environmentVariable() and setEnvironmentVariable() for the process environment, executablePath() for the current binary path, currentUserName() for the active user, and radlibVersionString() for the RADLib version string.
Core features:
Example: