In args::parse_args, rather than parsing const char** argv , parse char** argv and set those argv entries to null if they are matched.
Furthermore, in ParseCLI, only populate the std::vector<std::string> args vector with entries in argv which are not null.
With both suggestions, we can start nesting parsers. For example we parse a first set of flags, then go to the next set of flags depending on the result of the first parser, using the remaining non-null argv arguments.
In
args::parse_args, rather than parsingconst char** argv, parsechar** argvand set thoseargventries to null if they are matched.Furthermore, in ParseCLI, only populate the
std::vector<std::string> argsvector with entries inargvwhich are not null.With both suggestions, we can start nesting parsers. For example we parse a first set of flags, then go to the next set of flags depending on the result of the first parser, using the remaining non-null
argvarguments.