about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2023-06-23 22:34:12 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2023-07-21 10:00:02 +0100
commit7082eafd05b4f268132ab94772c0243dbebf5087 (patch)
tree549f66608f0cb4e50cee2e51c53206e798ab82cd /lib
parent974f140d79a621785b1fe4a0fc7fe321ba1089e2 (diff)
downloadklee-7082eafd05b4f268132ab94772c0243dbebf5087.tar.gz
Add code to only keep in the --help menu the KLEE/Kleaver option categories
Diffstat (limited to 'lib')
-rw-r--r--lib/Solver/SolverCmdLine.cpp16
1 files changed, 12 insertions, 4 deletions
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<bool> 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<llvm::cl::OptionCategory *> const &categories) {
   StringMap<cl::Option *> &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);
   }
 }