From 9704c3acd78ab5c561f4977a175dc72a1f31d1c7 Mon Sep 17 00:00:00 2001 From: Nitin Kumar <59679977+lazysegtree@users.noreply.github.com> Date: Thu, 22 Jan 2026 18:08:37 +0530 Subject: [PATCH] fix: Fix custom option parsing in case of CXXOPTS_NO_REGEX --- include/cxxopts.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 6b9f0fd..1a50874 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -758,8 +758,16 @@ inline ArguDesc ParseArgument(const char *arg, bool &matched) { pdata += 1; if(isalnum(*pdata, std::locale::classic())) { + // If we have '=' right after first alnum, its a match. + if(*(pdata+1) == '=') { + argu_desc.arg_name.push_back(*pdata); + argu_desc.set_value = true; + argu_desc.value = std::string(pdata+2); + } + else{ + argu_desc.arg_name = std::string(pdata); + } argu_desc.grouping = true; - argu_desc.arg_name = std::string(pdata); matched = true; } }