Defined in File cli_parser.hpp
CLI Parser class.
This class is used to parse the command line arguments. It uses CLI11 library internally.
The application binary (in C++) or the Python script (in Python) can be executed with various command-line options to run the App Driver and/or the App Worker:
--driver: Run the App Driver on the current machine. Can be used together with the
--workeroption to run both the App Driver and the App Worker on the same machine.
--worker: Run the App Worker.
--address: The address (
[<IPv4 address or hostname>][:<port>]) of the App Driver. If not specified, the App Driver uses the default host address (0.0.0.0) with the default port number (8765).
--worker-address: The address (
[<IPv4 address or hostname>][:<port>]) of the App Worker. If not specified, the App Worker uses the default host address (0.0.0.0) with the default port number randomly chosen from unused ports (between 10000 and 32767).
--fragments: The comma-separated names of the fragments to be executed by the App Worker. If not specified, only one fragment (selected by the App Driver) will be executed.
allcan be used to run all the fragments.
--config: The path to the configuration file. This will override the configuration file path configured in the application code (before run() is called).
--workeris specified, the application will run the application without the App Driver and the App Worker, as if the application were running in the single-node without network communication. Connections between fragments are replaced with the standard intra-fragment connections (double-buffered transmitter/receiver) used for operators.
- CLIParser() = default
Construct a new CLIParser object.
void initialize(std::string app_description = "", std::string app_version = "0.0.0")
Initialize the CLI Parser.
Set the application description and name and add options/flags for parsing.
app_description – The description of the application.
std::vector<std::string> &parse(std::vector<std::string> &argv)
Parse the command line arguments.
Parse the command line arguments and return the remaining arguments. * Note that the provided vector ‘argv’ will be modified.
argv – The reference to the vector of strings that contains the command line arguments.
The reference to the vector of strings that contains the remaining arguments (same as ‘argv’).
bool has_error() const
Check if there is an error during parsing.
true If there is an error during parsing.
Get the reference of the CLIOptions struct.
The reference of the CLIOptions struct.
- CLI::App app_
The CLI11 application object.
- bool is_initialized_ = false
The flag to check if the parser is initialized.
- bool has_error_ = false
The flag to check if there is an error during parsing.
- CLIOptions options_
The CLI options.