Lyra
Lyra copied to clipboard
choices() with a single string literal does not work
When calling choices("foo")
it appears the array overload is preferred, leading to the value not being accepted.
auto choice = std::string{};
cli.add_argument(
lyra::opt(choice, "your choice")
.name("--choice")
.choices("foo") // does not work
//.choices(std::string{"foo"}) // does work
.required());
When called with ./a.out --choice foo
it causes the error Unable to convert 'foo' to destination type
Demonstration: https://godbolt.org/z/YWvY3a96x