mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null.
llvm-svn: 17774
This commit is contained in:
parent
292678447a
commit
8bf3328ca7
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user