diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 1c06bf5f8c0..314dd951b2c 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -1889,6 +1889,15 @@ bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl &Argv, bool MarkEOLs = false); +/// \brief Mark all options not part of this category as cl::ReallyHidden. +/// +/// \param Category the category of options to keep displaying +/// +/// Some tools (like clang-format) like to be able to hide all options that are +/// not specific to the tool. This function allows a tool to specify a single +/// option category to display in the -help output. +void HideUnrelatedOptions(cl::OptionCategory &Category); + } // End namespace cl } // End namespace llvm diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 40570cab7cc..a774421b26c 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1826,12 +1826,22 @@ void cl::AddExtraVersionPrinter(void (*func)()) { void cl::getRegisteredOptions(StringMap