From 6e691daefc2454a7d517a1071a2339f70fe9494a Mon Sep 17 00:00:00 2001 From: Thierry Treyer Date: Thu, 15 Jun 2023 06:43:58 -0700 Subject: [PATCH] OITB support for -f/-F feature flags --- tools/OITB.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/OITB.cpp b/tools/OITB.cpp index f7113d9..d045c5a 100644 --- a/tools/OITB.cpp +++ b/tools/OITB.cpp @@ -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...