This commit adds a color category so tools can document this option and
enables it for dwarfdump and dsymuttil.
rdar://problem/
40498996
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333176
91177308-0d34-0410-b5e6-
96231b3b80d8
namespace llvm {
+extern cl::OptionCategory ColorCategory;
+
class raw_ostream;
// Symbolic names for various syntax elements.
using namespace llvm;
+cl::OptionCategory llvm::ColorCategory("Color Options");
+
static cl::opt<cl::boolOrDefault>
- UseColor("color",
- cl::desc("use colored syntax highlighting (default=autodetect)"),
+ UseColor("color", cl::cat(ColorCategory),
+ cl::desc("Use colors in output (default=autodetect)"),
cl::init(cl::BOU_UNSET));
bool WithColor::colorsEnabled(raw_ostream &OS) {
HELP: OVERVIEW: manipulate archived DWARF debug symbol files.
HELP: USAGE: dsymutil{{[^ ]*}} [options] <input files>
HELP-NOT: -reverse-iterate
+HELP: Color Options
+HELP: -color
HELP: Specific Options:
HELP: -arch=<arch>
HELP: -dump-debug-map
RUN: llvm-dwarfdump --help 2>&1 | FileCheck --check-prefix=HELP %s
HELP: USAGE: llvm-dwarfdump{{[^ ]*}} [options] <input object files or .dSYM bundles>
HELP-NOT: -reverse-iterate
+HELP: Color Options
+HELP: -color
HELP: Section-specific Dump Options
HELP: -debug-info - Dump the .debug_info section
HELP: -eh-frame
std::string SDKPath = llvm::sys::fs::getMainExecutable(argv[0], P);
SDKPath = llvm::sys::path::parent_path(SDKPath);
- HideUnrelatedOptions(DsymCategory);
+ HideUnrelatedOptions({&DsymCategory, &ColorCategory});
llvm::cl::ParseCommandLineOptions(
argc, argv,
"manipulate archived DWARF debug symbol files.\n\n"
#include "llvm/Support/Regex.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
- HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory});
+ HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory, &ColorCategory});
cl::ParseCommandLineOptions(
argc, argv,
"pretty-print DWARF debug information in object files"