From 947d6055f37d847d5fcdf25c0f48eb7f081ab593 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bayle Date: Mon, 27 May 2019 09:55:10 +0200 Subject: [PATCH] Parse 1 as "true" and 0 as "false" for boolean options --- include/cxxopts.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index c449368..63d6336 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -466,9 +466,9 @@ namespace cxxopts std::basic_regex integer_pattern ("(-)?(0x)?([0-9a-zA-Z]+)|((0x)?0)"); std::basic_regex truthy_pattern - ("(t|T)(rue)?"); + ("(t|T)(rue)?|1"); std::basic_regex falsy_pattern - ("((f|F)(alse)?)?"); + ("(f|F)(alse)?|0"); } namespace detail