diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-14 22:04:00 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-14 22:04:00 +0000 |
commit | 1f4ab8b4496bf49f5277dbd74b206dab43dc8ba9 (patch) | |
tree | c0ac99d50ad40cd2adf73830d964ddda66b832b6 /llvm/lib/Support/CommandLine.cpp | |
parent | c470261d2781b05a3da5a6a26d4771bed1ccec1e (diff) | |
download | bcm5719-llvm-1f4ab8b4496bf49f5277dbd74b206dab43dc8ba9.tar.gz bcm5719-llvm-1f4ab8b4496bf49f5277dbd74b206dab43dc8ba9.zip |
Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null.
llvm-svn: 17774
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 90afa0d9e33..ad82c849479 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -834,6 +834,12 @@ void generic_parser_base::printOptionInfo(const Option &O, //===----------------------------------------------------------------------===// // --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 @@ public: 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); } |