clipp
clipp copied to clipboard
Strange behavior with one_of
I have this code:
#include <iostream>
#include "clipp.h"
int main(int argc, char *argv[])
{
std::string foo, bar, baz;
auto a = (
clipp::value("bar", bar)
);
auto b = (
clipp::value("foo", foo),
clipp::value("bar", bar)
);
auto cli = (a | b);
if (!clipp::parse(argc, argv, cli)) {
std::cerr << clipp::usage_lines(cli, argv[0]) << std::endl;
return EXIT_FAILURE;
}
}
Running c++ -std=c++17 main.cpp && ./a.out foo bar
shows me the usage lines even though it's compatible.
Yeah that seems to be a bug. I also think that I already know where it goes wrong.
Have you been able to fix this yet @muellan ? What keeps resulting in this error?