mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
OITB support for -f/-F feature flags
This commit is contained in:
parent
4e730fbc95
commit
6e691daefc
@ -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...
|
||||
|
Loading…
Reference in New Issue
Block a user