[llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h
Reid Spencer
reid at x10sys.com
Mon Nov 15 22:12:03 PST 2004
Changes in directory llvm/include/llvm/Support:
CommandLine.h updated: 1.38 -> 1.39
---
Log message:
Per code review:
*Implement/Document the cl::extrahelp feature instead of the MoreHelp ptr.
---
Diffs of the changes: (+13 -7)
Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.38 llvm/include/llvm/Support/CommandLine.h:1.39
--- llvm/include/llvm/Support/CommandLine.h:1.38 Sun Nov 14 15:49:13 2004
+++ llvm/include/llvm/Support/CommandLine.h Tue Nov 16 00:11:52 2004
@@ -1046,13 +1046,19 @@
void apply(alias &A) const { A.setAliasFor(Opt); }
};
-/// Permit the tool to provide additional help output after the normal
-/// help output. To use this, create a function that returns void and
-/// takes no arguments. Assign its address to cl::MoreHelp. If set,
-/// this function will be called just before the CommandLine exits
-/// after printing the help.
-/// @brief Optional pointer to additional help function
-extern void (*MoreHelp)();
+// extrahelp - provide additional help at the end of the normal help
+// output. All occurrences of cl::extrahelp will be accumulated and
+// printed to std::cerr at the end of the regular help, just before
+// exit is called.
+struct extrahelp {
+ const char * morehelp;
+ extrahelp(const char* help);
+};
+
+// This function just prints the help message, exactly the same way as if the
+// --help option had been given on the command line.
+// NOTE: THIS FUNCTION TERMINATES THE PROGRAM!
+void PrintHelpMessage();
} // End namespace cl
More information about the llvm-commits
mailing list