FDBMonitor now supports “flag_X=<true/false>” in all sections, with the usual inheritance, in order to enable (true) or disable (false) the passing of a parameterless command line named X as “—X”.

This commit is contained in:
Stephen Atherton 2017-09-26 22:13:01 -07:00
parent 02525d7b14
commit 333fb65a91
1 changed files with 11 additions and 1 deletions

View File

@ -386,7 +386,17 @@ public:
while ((pos = opt.find("$ID", pos)) != opt.npos)
opt.replace(pos, 3, id_s, strlen(id_s));
commands.push_back(std::string("--").append(i.pItem).append("=").append(opt));
const char *flagName = i.pItem + 5;
if(strncmp("flag_", i.pItem, 5) == 0 && strlen(flagName) > 0) {
if(opt == "true")
commands.push_back(std::string("--") + flagName);
else if(opt != "false") {
log_msg(LOG_ERR, "Bad flag value, must be true/false. Flag: '%s' Value: '%s'\n", flagName, opt.c_str());
return;
}
}
else
commands.push_back(std::string("--").append(i.pItem).append("=").append(opt));
}
argv = new const char* [commands.size() + 1];