v0.0.128: [Util] Extend `ArgParser` to support lists.
·
458 commits
to main
since this release
Extend the `ArgParser` to support CLI arguments with lists of strings. For example, one can now implement an argument like ``` --colors "yellow,green,navy blue,pink" ``` The type of the argument must be `std::vector<std::string_view>`. To implement such a CLI argument in our shell, you can do ```cpp ADD(std::vector<std::string_view>, void *_, nullptr, nullptr, "--colors", "A comma-separated list of colors.", [&](std::vector<std::string_view> colors) { std::cerr << "received colors are:\n"; for (auto color : colors) std::cerr << " " << color << '\n'; }); ```