From 7082eafd05b4f268132ab94772c0243dbebf5087 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 23 Jun 2023 22:34:12 +0100 Subject: Add code to only keep in the --help menu the KLEE/Kleaver option categories --- lib/Solver/SolverCmdLine.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/Solver/SolverCmdLine.cpp b/lib/Solver/SolverCmdLine.cpp index b0bff6e6..a371d5e4 100644 --- a/lib/Solver/SolverCmdLine.cpp +++ b/lib/Solver/SolverCmdLine.cpp @@ -112,16 +112,24 @@ cl::opt UseAssignmentValidatingSolver( cl::desc("Debug the correctness of generated assignments (default=false)"), cl::cat(SolvingCat)); - -void KCommandLine::HideOptions(llvm::cl::OptionCategory &Category) { +void KCommandLine::KeepOnlyCategories( + std::set const &categories) { StringMap &map = cl::getRegisteredOptions(); for (auto &elem : map) { + if (elem.first() == "version" || elem.first() == "color" || + elem.first() == "help" || elem.first() == "help-list") + continue; + + bool keep = false; for (auto &cat : elem.second->Categories) { - if (cat == &Category) { - elem.second->setHiddenFlag(cl::Hidden); + if (categories.find(cat) != categories.end()) { + keep = true; + break; } } + if (!keep) + elem.second->setHiddenFlag(cl::Hidden); } } -- cgit 1.4.1