Parse 1 as "true" and 0 as "false" for boolean options

This commit is contained in:
Jean-Baptiste Bayle 2019-05-27 09:55:10 +02:00
parent d58271c5fd
commit 947d6055f3

View File

@ -466,9 +466,9 @@ namespace cxxopts
std::basic_regex<char> integer_pattern
("(-)?(0x)?([0-9a-zA-Z]+)|((0x)?0)");
std::basic_regex<char> truthy_pattern
("(t|T)(rue)?");
("(t|T)(rue)?|1");
std::basic_regex<char> falsy_pattern
("((f|F)(alse)?)?");
("(f|F)(alse)?|0");
}
namespace detail