Utility library for VertexNova projects providing common helpers for command-line parsing, file I/O, threading, and more.
- Command Line Parser - Flexible argument parsing with support for options, flags, and positional arguments
- C++20 or later
- CMake 3.16 or later
git clone --recursive https://github.com/vertexnova/vneutils.git
cd vneutils
./scripts/build_macos.shgit clone --recursive https://github.com/vertexnova/vneutils.git
cd vneutils
python scripts/build_windows.pycmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build --config Release
ctest --test-dir build#include "vertexnova/utils/command_line_parser.h"
int main(int argc, char* argv[]) {
vne::utils::CommandLineParser parser("MyApp", "1.0.0");
parser.addOption({"--width", "-w"}, "Window width", "pixels", "1920");
parser.addOption({"--height", "-h"}, "Window height", "pixels", "1080");
parser.addOption({"--fullscreen", "-f"}, "Run in fullscreen mode");
if (!parser.parse(argc, argv)) {
std::cerr << parser.getErrorMessage() << std::endl;
return 1;
}
if (parser.isHelpRequested()) {
parser.showHelp();
return 0;
}
int width = std::stoi(parser.value("--width"));
int height = std::stoi(parser.value("--height"));
bool fullscreen = parser.isSet("--fullscreen");
// Use the values...
return 0;
}| Module | Description |
|---|---|
| VneCMake | Shared CMake modules for VertexNova projects |
Apache License 2.0 - See LICENSE for details.