cl::desc("Additional argument to prepend to the compiler command line"),
cl::cat(Category));
- // Hide unrelated options.
- StringMap<cl::Option*> Options;
- cl::getRegisteredOptions(Options);
- for (StringMap<cl::Option *>::iterator I = Options.begin(), E = Options.end();
- I != E; ++I) {
- if (I->second->Category != &Category && I->first() != "help" &&
- I->first() != "version")
- I->second->setHiddenFlag(cl::ReallyHidden);
- }
+ cl::HideUnrelatedOptions(Category);
Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
argv));
int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal();
- // Hide unrelated options.
- StringMap<cl::Option*> Options;
- cl::getRegisteredOptions(Options);
- for (StringMap<cl::Option *>::iterator I = Options.begin(), E = Options.end();
- I != E; ++I) {
- if (I->second->Category != &ClangFormatCategory && I->first() != "help" &&
- I->first() != "version")
- I->second->setHiddenFlag(cl::ReallyHidden);
- }
+ cl::HideUnrelatedOptions(ClangFormatCategory);
cl::SetVersionPrinter(PrintVersion);
cl::ParseCommandLineOptions(