Index: llvm/test/tools/llvm-strings/help.test =================================================================== --- llvm/test/tools/llvm-strings/help.test +++ llvm/test/tools/llvm-strings/help.test @@ -8,8 +8,9 @@ CHECK: OVERVIEW: llvm string dumper CHECK: USAGE: llvm-strings{{(.exe)?}} [options] {{$}} CHECK: OPTIONS: -CATEG: General options: -LIST-NOT: General options: +CATEG: Color Options: CATEG: Generic Options: -LIST-NOT: Generic Options: +LIST-NOT: General options: +CATEG: Strings Options: +LIST-NOT: Strings Options: CHECK: @FILE Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp =================================================================== --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -32,37 +32,48 @@ #include "llvm/Support/Error.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include using namespace llvm; -static cl::opt - InputFilename(cl::Positional, cl::desc(""), cl::init("-")); +static cl::OptionCategory BCAnalyzerOptions("BC Analyzer Options"); + +static cl::opt InputFilename(cl::Positional, + cl::desc(""), + cl::init("-"), + cl::cat(BCAnalyzerOptions)); -static cl::opt Dump("dump", cl::desc("Dump low level bitcode trace")); +static cl::opt Dump("dump", cl::desc("Dump low level bitcode trace"), + cl::cat(BCAnalyzerOptions)); //===----------------------------------------------------------------------===// // Bitcode specific analysis. //===----------------------------------------------------------------------===// static cl::opt NoHistogram("disable-histogram", - cl::desc("Do not print per-code histogram")); + cl::desc("Do not print per-code histogram"), + cl::cat(BCAnalyzerOptions)); static cl::opt NonSymbolic("non-symbolic", cl::desc("Emit numeric info in dump even if" - " symbolic info is available")); + " symbolic info is available"), + cl::cat(BCAnalyzerOptions)); static cl::opt BlockInfoFilename("block-info", - cl::desc("Use the BLOCK_INFO from the given file")); + cl::desc("Use the BLOCK_INFO from the given file"), + cl::cat(BCAnalyzerOptions)); static cl::opt ShowBinaryBlobs("show-binary-blobs", - cl::desc("Print binary blobs using hex escapes")); + cl::desc("Print binary blobs using hex escapes"), + cl::cat(BCAnalyzerOptions)); static cl::opt CheckHash( "check-hash", - cl::desc("Check module hash using the argument as a string table")); + cl::desc("Check module hash using the argument as a string table"), + cl::cat(BCAnalyzerOptions)); static Error reportError(StringRef Message) { return createStringError(std::errc::illegal_byte_sequence, Message.data()); @@ -85,6 +96,7 @@ int main(int argc, char **argv) { InitLLVM X(argc, argv); + cl::HideUnrelatedOptions({&BCAnalyzerOptions, &llvm::ColorCategory}); cl::ParseCommandLineOptions(argc, argv, "llvm-bcanalyzer file analyzer\n"); ExitOnError ExitOnErr("llvm-bcanalyzer: "); Index: llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp =================================================================== --- llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -33,9 +33,10 @@ using namespace llvm::support; namespace opts { +cl::OptionCategory CXXDumpOptions("CXX Dump Options"); cl::list InputFilenames(cl::Positional, cl::desc(""), - cl::ZeroOrMore); + cl::cat(CXXDumpOptions), cl::ZeroOrMore); } // namespace opts namespace llvm { @@ -549,6 +550,7 @@ // Register the target printer for --version. cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); + cl::HideUnrelatedOptions({&opts::CXXDumpOptions, &llvm::ColorCategory}); cl::ParseCommandLineOptions(argc, argv, "LLVM C++ ABI Data Dumper\n"); // Default to stdin if no filename is specified. Index: llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp =================================================================== --- llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp +++ llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp @@ -12,6 +12,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Host.h" #include "llvm/Support/InitLLVM.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -29,37 +30,40 @@ Java, ///< Java (gcj) GNAT ///< ADA compiler (gnat) }; +static cl::OptionCategory CXXFiltOptions("CXX Filt Options"); static cl::opt