llvm.org GIT mirror llvm / ad0846b
Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17774 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 15 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
833833 //===----------------------------------------------------------------------===//
834834 // --help and --help-hidden option implementation
835835 //
836
837 // If this variable is set, it is a pointer to a function that the user wants
838 // us to call after we print out the help info. Basically a hook to allow
839 // additional help to be printed.
840 void (*cl::MoreHelp)() = 0;
841
836842 namespace {
837843
838844 class HelpPrinter {
906912 for (unsigned i = 0, e = Options.size(); i != e; ++i)
907913 Options[i].second->printOptionInfo(MaxArgLen);
908914
915 // Call the user's hook so help output can be extended.
916 if (MoreHelp != 0)
917 (*MoreHelp)();
918
909919 // Halt the program if help information is printed
910920 exit(1);
911921 }