Closed schoetbi closed 2 years ago
I like to return an error if parsing of an argument inside a lambda expression fails. Is there such an option? How can I return an error if the parsing fails, in this case if the IP address is invalid?
lyra::opt([&](const std::string& ip_string) { bool success = cmdpara.SourceIpAddress(ip_string); return success; }, "ip address ") ["-i"] ["--ip_address"] ("address virtual nic rtx side (default localhost)"));
I found the coice option. This should work.
https://github.com/bfgroup/Lyra/blob/develop/examples/doc_example6.cpp#L18
I like to return an error if parsing of an argument inside a lambda expression fails. Is there such an option? How can I return an error if the parsing fails, in this case if the IP address is invalid?