Open schenker opened 10 months ago
I'm encountering unexpected results with lyra 1.6.1 and the following program:
lyra 1.6.1
#include <iostream> #include <lyra/lyra.hpp> int main(int argc, char* argv[]) { std::string first_arg; std::string second_arg; auto cli = lyra::cli() | lyra::arg(first_arg, "first_arg").required().choices("A", "B") | lyra::arg(second_arg, "second_arg").required(); const auto result = cli.parse({argc, argv}); if (!result) { std::cerr << "Error: " << result.message() << std::endl; return EXIT_FAILURE; } std::cout << "first_arg: " << first_arg << ", second_arg: " << second_arg; return EXIT_SUCCESS; }
Calling this program with
$ ./a.out arg1 B
gives me the this output:
first_arg: B, second_arg: arg1
The two arguments are mixed up. I would expect parse() to return false.
parse()
false
I'm encountering unexpected results with
lyra 1.6.1
and the following program:Calling this program with
gives me the this output:
The two arguments are mixed up. I would expect
parse()
to returnfalse
.