DirectZ
|
Parses and stores command line program arguments. More...
#include <ProgramArgs.hpp>
Public Member Functions | |
ProgramArgs (int argc, char **argv) | |
Constructs the ProgramArgs object by parsing command line arguments. |
Public Attributes | |
std::unordered_map< std::string, std::string > | options |
Map storing options parsed from command line arguments. | |
std::vector< std::string > | arguments |
Vector of positional arguments parsed from command line. |
Parses and stores command line program arguments.
Splits command line input into options (key-value pairs) and positional arguments. The options map keys are strings stripped of the leading dash. The arguments vector holds all positional arguments in order.
|
inline |
Constructs the ProgramArgs object by parsing command line arguments.
Parses argc and argv from main() according to rules:
argc | Number of command line arguments. |
argv | Array of C-string arguments. |
std::vector<std::string> dz::ProgramArgs::arguments |
Vector of positional arguments parsed from command line.
Arguments that do not begin with a dash are stored here, preserving order.
std::unordered_map<std::string, std::string> dz::ProgramArgs::options |
Map storing options parsed from command line arguments.
Keys are option names (without leading dash). Values are option values, or empty string if no value was provided.