we encode the description of a certain command, with comma-separated
values, which are represented in "key=value" form. the keys are a set of
configuration names, and their values' types are known. among them,
"positional" and "req" are of boolean type. before this change, we
consider "true" and "True" as true, otherwise we consider the value as
false. but this setting leads to confusion and could be a headache for
maintainers.
since all commands are determined at compile-time, and all commands'
descs use "req=true" or "req=false" if "req" is specified, we are
allowed to tighten the check to enforce that these values are "true"
or "false".
this change serves as part of a sanity check of all command
descriptions, as all command descriptions are formatted into JSON
with the "get_command_description" asok command and the mon command
with the same name. and it does not change the runtime behavior.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
if (!HAVE_FEATURE(features, SERVER_QUINCY)) {
continue;
}
- f->dump_bool(key, value == "true" || value == "True");
+ assert(value == "true" || value == "false");
+ f->dump_bool(key, value == "true");
} else if (key == "req" && HAVE_FEATURE(features, SERVER_QUINCY)) {
- f->dump_bool(key, value == "true" || value == "True");
+ assert(value == "true" || value == "false");
+ f->dump_bool(key, value == "true");
} else {
f->dump_string(key, value);
}