OITB support for -f/-F feature flags

This commit is contained in:
Thierry Treyer 2023-06-15 06:43:58 -07:00 committed by Thierry Treyer
parent 4e730fbc95
commit 6e691daefc

View File

@ -46,6 +46,18 @@ constexpr static OIOpts opts{
OIOpt{'J', "dump-json", optional_argument, "[oid_out.json]",
"File to dump the results to, as JSON\n"
"(in addition to the default RocksDB output)"},
OIOpt{'f', "enable-feature", required_argument, nullptr,
"Enable a specific feature: ["
#define X(name, str) str ","
OI_FEATURE_LIST
#undef X
"]"},
OIOpt{'F', "disable-feature", required_argument, nullptr,
"Disable a specific feature: ["
#define X(name, str) str ","
OI_FEATURE_LIST
#undef X
"]"},
};
static void usage(std::ostream& out) {
@ -152,6 +164,15 @@ int main(int argc, char* argv[]) {
usage(std::cout);
exit(EXIT_SUCCESS);
case 'F':
[[fallthrough]];
case 'f':
if (auto f = featureFromStr(optarg); f != Feature::UnknownFeature)
tbConfig.features[f] = c == 'f'; // '-f' enables, '-F' disables
else
fatal_error("Invalid feature specified: ", optarg);
break;
case 'a':
tbConfig.logAllStructs =
true; // Weird that we're setting it to true, again...