[llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp

Reid Spencer reid at x10sys.com
Sun Nov 14 14:04:37 PST 2004



Changes in directory llvm/lib/Support:

CommandLine.cpp updated: 1.51 -> 1.52
---
Log message:

Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null.

---
Diffs of the changes:  (+10 -0)

Index: llvm/lib/Support/CommandLine.cpp
diff -u llvm/lib/Support/CommandLine.cpp:1.51 llvm/lib/Support/CommandLine.cpp:1.52
--- llvm/lib/Support/CommandLine.cpp:1.51	Sat Nov  6 18:58:38 2004
+++ llvm/lib/Support/CommandLine.cpp	Sun Nov 14 16:04:00 2004
@@ -834,6 +834,12 @@
 //===----------------------------------------------------------------------===//
 // --help and --help-hidden option implementation
 //
+
+// If this variable is set, it is a pointer to a function that the user wants
+// us to call after we print out the help info. Basically a hook to allow
+// additional help to be printed.
+void (*cl::MoreHelp)() = 0;
+
 namespace {
 
 class HelpPrinter {
@@ -907,6 +913,10 @@
     for (unsigned i = 0, e = Options.size(); i != e; ++i)
       Options[i].second->printOptionInfo(MaxArgLen);
 
+    // Call the user's hook so help output can be extended.
+    if (MoreHelp != 0)
+      (*MoreHelp)();
+
     // Halt the program if help information is printed
     exit(1);
   }






More information about the llvm-commits mailing list