Index: llvm/test/tools/llvm-cxxdump/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-cxxdump/help.test @@ -0,0 +1,6 @@ +# RUN: llvm-cxxdump --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: OVERVIEW: LLVM C++ ABI Data Dumper +# HELP: USAGE +# HELP: Color Options +# HELP: Generic Options Index: llvm/test/tools/llvm-cxxmap/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-cxxmap/help.test @@ -0,0 +1,7 @@ +# RUN: llvm-cxxmap --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: OVERVIEW: LLVM C++ mangled name remapper +# HELP: USAGE +# HELP: CXX Map Options +# HELP: Color Options +# HELP: Generic Options Index: llvm/test/tools/llvm-diff/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-diff/help.test @@ -0,0 +1,5 @@ +# RUN: llvm-diff --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: USAGE +# HELP: Color Options +# HELP: Generic Options Index: llvm/test/tools/llvm-dis/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dis/help.test @@ -0,0 +1,7 @@ +# RUN: llvm-dis --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: OVERVIEW +# HELP: USAGE +# HELP: Color Options +# HELP: Disassembler Options +# HELP: Generic Options Index: llvm/test/tools/llvm-dwp/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dwp/help.test @@ -0,0 +1,7 @@ +# RUN: llvm-dwp --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: OVERVIEW +# HELP: USAGE +# HELP: Color Options +# HELP: Generic Options +# HELP: Specific Options Index: llvm/test/tools/llvm-elfabi/help.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-elfabi/help.test @@ -0,0 +1,6 @@ +# RUN: llvm-elfabi --help | FileCheck %s --check-prefix HELP --implicit-check-not='{{[Oo]}}ptions:' + +# HELP: USAGE +# HELP: Color Options +# HELP: ElfAbi Options +# HELP: Generic Options 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 CXXDumpCategory("CXX Dump Options"); cl::list InputFilenames(cl::Positional, cl::desc(""), - cl::ZeroOrMore); + cl::ZeroOrMore, cl::cat(CXXDumpCategory)); } // namespace opts namespace llvm { @@ -549,6 +550,7 @@ // Register the target printer for --version. cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); + cl::HideUnrelatedOptions({&opts::CXXDumpCategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv, "LLVM C++ ABI Data Dumper\n"); // Default to stdin if no filename is specified. Index: llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp =================================================================== --- llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp +++ llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp @@ -25,23 +25,33 @@ using namespace llvm; +cl::OptionCategory CXXMapCategory("CXX Map Options"); + cl::opt OldSymbolFile(cl::Positional, cl::Required, - cl::desc("")); + cl::desc(""), + cl::cat(CXXMapCategory)); cl::opt NewSymbolFile(cl::Positional, cl::Required, - cl::desc("")); + cl::desc(""), + cl::cat(CXXMapCategory)); cl::opt RemappingFile("remapping-file", cl::Required, - cl::desc("Remapping file")); -cl::alias RemappingFileA("r", cl::aliasopt(RemappingFile)); + cl::desc("Remapping file"), + cl::cat(CXXMapCategory)); +cl::alias RemappingFileA("r", cl::aliasopt(RemappingFile), + cl::cat(CXXMapCategory)); cl::opt OutputFilename("output", cl::value_desc("output"), - cl::init("-"), cl::desc("Output file")); -cl::alias OutputFilenameA("o", cl::aliasopt(OutputFilename)); + cl::init("-"), cl::desc("Output file"), + cl::cat(CXXMapCategory)); +cl::alias OutputFilenameA("o", cl::aliasopt(OutputFilename), + cl::cat(CXXMapCategory)); cl::opt WarnAmbiguous( "Wambiguous", - cl::desc("Warn on equivalent symbols in the output symbol list")); + cl::desc("Warn on equivalent symbols in the output symbol list"), + cl::cat(CXXMapCategory)); cl::opt WarnIncomplete( "Wincomplete", - cl::desc("Warn on input symbols missing from output symbol list")); + cl::desc("Warn on input symbols missing from output symbol list"), + cl::cat(CXXMapCategory)); static void warn(Twine Message, Twine Whence = "", std::string Hint = "") { @@ -131,6 +141,7 @@ int main(int argc, const char *argv[]) { InitLLVM X(argc, argv); + cl::HideUnrelatedOptions({&CXXMapCategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv, "LLVM C++ mangled name remapper\n"); auto OldSymbolBufOrError = MemoryBuffer::getFileOrSTDIN(OldSymbolFile); Index: llvm/tools/llvm-diff/llvm-diff.cpp =================================================================== --- llvm/tools/llvm-diff/llvm-diff.cpp +++ llvm/tools/llvm-diff/llvm-diff.cpp @@ -55,16 +55,20 @@ errs() << "No function named @" << Name << " in right module\n"; } +cl::OptionCategory DiffCategory("Diff Options"); + static cl::opt LeftFilename(cl::Positional, - cl::desc(""), - cl::Required); + cl::desc(""), cl::Required, + cl::cat(DiffCategory)); static cl::opt RightFilename(cl::Positional, cl::desc(""), - cl::Required); + cl::Required, cl::cat(DiffCategory)); static cl::list GlobalsToCompare(cl::Positional, - cl::desc("")); + cl::desc(""), + cl::cat(DiffCategory)); int main(int argc, char **argv) { + cl::HideUnrelatedOptions({&DiffCategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv); LLVMContext Context; Index: llvm/tools/llvm-dis/llvm-dis.cpp =================================================================== --- llvm/tools/llvm-dis/llvm-dis.cpp +++ llvm/tools/llvm-dis/llvm-dis.cpp @@ -35,37 +35,44 @@ #include using namespace llvm; +static cl::OptionCategory DisCategory("Disassembler Options"); + static cl::list InputFilenames(cl::Positional, cl::ZeroOrMore, - cl::desc("[input bitcode]...")); + cl::desc("[input bitcode]..."), + cl::cat(DisCategory)); -static cl::opt -OutputFilename("o", cl::desc("Override output filename"), - cl::value_desc("filename")); +static cl::opt OutputFilename("o", + cl::desc("Override output filename"), + cl::value_desc("filename"), + cl::cat(DisCategory)); -static cl::opt -Force("f", cl::desc("Enable binary output on terminals")); +static cl::opt Force("f", cl::desc("Enable binary output on terminals"), + cl::cat(DisCategory)); -static cl::opt -DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden); +static cl::opt DontPrint("disable-output", + cl::desc("Don't output the .ll file"), + cl::Hidden, cl::cat(DisCategory)); static cl::opt SetImporting("set-importing", cl::desc("Set lazy loading to pretend to import a module"), - cl::Hidden); + cl::Hidden, cl::cat(DisCategory)); static cl::opt ShowAnnotations("show-annotations", - cl::desc("Add informational comments to the .ll file")); + cl::desc("Add informational comments to the .ll file"), + cl::cat(DisCategory)); static cl::opt PreserveAssemblyUseListOrder( "preserve-ll-uselistorder", cl::desc("Preserve use-list order when writing LLVM assembly."), - cl::init(false), cl::Hidden); + cl::init(false), cl::Hidden, cl::cat(DisCategory)); static cl::opt MaterializeMetadata("materialize-metadata", cl::desc("Load module without materializing metadata, " - "then materialize only the metadata")); + "then materialize only the metadata"), + cl::cat(DisCategory)); namespace { @@ -151,6 +158,7 @@ ExitOnErr.setBanner(std::string(argv[0]) + ": error: "); + cl::HideUnrelatedOptions({&DisCategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n"); LLVMContext Context; Index: llvm/tools/llvm-dwp/llvm-dwp.cpp =================================================================== --- llvm/tools/llvm-dwp/llvm-dwp.cpp +++ llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -942,6 +942,7 @@ int main(int argc, char **argv) { InitLLVM X(argc, argv); + cl::HideUnrelatedOptions({&DwpCategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv, "merge split dwarf (.dwo) files\n"); llvm::InitializeAllTargetInfos(); Index: llvm/tools/llvm-elfabi/llvm-elfabi.cpp =================================================================== --- llvm/tools/llvm-elfabi/llvm-elfabi.cpp +++ llvm/tools/llvm-elfabi/llvm-elfabi.cpp @@ -30,22 +30,25 @@ using namespace llvm::elfabi; // Command line flags: +cl::OptionCategory ELFABICategory("ElfAbi Options"); + cl::opt InputFileFormat( cl::desc("Force input file format:"), cl::values(clEnumValN(FileFormat::TBE, "tbe", "Read `input` as text-based ELF stub"), clEnumValN(FileFormat::ELF, "elf", - "Read `input` as ELF binary"))); + "Read `input` as ELF binary")), + cl::cat(ELFABICategory)); cl::opt InputFilePath(cl::Positional, cl::desc("input"), - cl::Required); + cl::Required, cl::cat(ELFABICategory)); cl::opt EmitTBE("emit-tbe", cl::desc("Emit a text-based ELF stub (.tbe) from the input file"), - cl::value_desc("path")); + cl::value_desc("path"), cl::cat(ELFABICategory)); cl::opt SOName("soname", cl::desc("Manually set the DT_SONAME entry of any emitted files"), - cl::value_desc("name")); + cl::value_desc("name"), cl::cat(ELFABICategory)); cl::opt BinaryOutputTarget( "output-target", cl::desc("Create a binary stub for the specified target"), cl::values(clEnumValN(ELFTarget::ELF32LE, "elf32-little", @@ -55,11 +58,13 @@ clEnumValN(ELFTarget::ELF64LE, "elf64-little", "64-bit little-endian ELF stub"), clEnumValN(ELFTarget::ELF64BE, "elf64-big", - "64-bit big-endian ELF stub"))); + "64-bit big-endian ELF stub")), + cl::cat(ELFABICategory)); cl::opt BinaryOutputFilePath(cl::Positional, cl::desc("output")); cl::opt WriteIfChanged( "write-if-changed", - cl::desc("Write the output file only if it is new or has changed.")); + cl::desc("Write the output file only if it is new or has changed."), + cl::cat(ELFABICategory)); /// writeTBE() writes a Text-Based ELF stub to a file using the latest version /// of the YAML parser. @@ -144,6 +149,7 @@ int main(int argc, char *argv[]) { // Parse arguments. + cl::HideUnrelatedOptions({&ELFABICategory, &getColorCategory()}); cl::ParseCommandLineOptions(argc, argv); Expected> StubOrErr = readInputFile(InputFilePath);