From 81900dc4982dc03da859a75c927e1bba95837c30 Mon Sep 17 00:00:00 2001 From: gbreynoo Date: Wed, 12 May 2021 12:09:08 +0100 Subject: [PATCH] [llvm-readelf] Unhide short options to match the command guide The readelf command guide shows the short options used as aliases but these are not found in the help text unless --show-hidden is used, other tools show aliases with --help. This change fixes the help output to be consistent with the command guide. Differential Revision: https://reviews.llvm.org/D102173 --- llvm/tools/llvm-readobj/llvm-readobj.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index 7db52e63da47..86f9a0a85566 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -72,7 +72,7 @@ namespace opts { cl::desc("Equivalent to setting: --file-headers, --program-headers, " "--section-headers")); cl::alias HeadersShort("e", cl::desc("Alias for --headers"), - cl::aliasopt(Headers)); + cl::aliasopt(Headers), cl::NotHidden); // --wide, -W cl::opt @@ -131,7 +131,8 @@ namespace opts { // --notes, -n cl::opt Notes("notes", cl::desc("Display the ELF notes in the file")); - cl::alias NotesShort("n", cl::desc("Alias for --notes"), cl::aliasopt(Notes)); + cl::alias NotesShort("n", cl::desc("Alias for --notes"), cl::aliasopt(Notes), + cl::NotHidden); // --dyn-relocations cl::opt DynRelocs("dyn-relocations", @@ -166,9 +167,8 @@ namespace opts { // --unwind, -u cl::opt UnwindInfo("unwind", cl::desc("Display unwind information")); - cl::alias UnwindInfoShort("u", - cl::desc("Alias for --unwind"), - cl::aliasopt(UnwindInfo)); + cl::alias UnwindInfoShort("u", cl::desc("Alias for --unwind"), + cl::aliasopt(UnwindInfo), cl::NotHidden); // --dynamic-table, --dynamic, -d cl::opt DynamicTable("dynamic-table", @@ -196,7 +196,8 @@ namespace opts { cl::desc("Display the specified section(s) as a list of strings"), cl::ZeroOrMore); cl::alias StringDumpShort("p", cl::desc("Alias for --string-dump"), - cl::aliasopt(StringDump), cl::Prefix); + cl::aliasopt(StringDump), cl::Prefix, + cl::NotHidden); // --hex-dump, -x cl::list @@ -204,7 +205,7 @@ namespace opts { cl::desc("Display the specified section(s) as hexadecimal bytes"), cl::ZeroOrMore); cl::alias HexDumpShort("x", cl::desc("Alias for --hex-dump"), - cl::aliasopt(HexDump), cl::Prefix); + cl::aliasopt(HexDump), cl::Prefix, cl::NotHidden); // --demangle, -C cl::opt Demangle("demangle", @@ -340,7 +341,7 @@ namespace opts { VersionInfo("version-info", cl::desc("Display ELF version sections (if present)")); cl::alias VersionInfoShort("V", cl::desc("Alias for -version-info"), - cl::aliasopt(VersionInfo)); + cl::aliasopt(VersionInfo), cl::NotHidden); // --elf-section-groups, --section-groups, -g cl::opt SectionGroups("elf-section-groups", @@ -349,14 +350,14 @@ namespace opts { cl::desc("Alias for -elf-sections-groups"), cl::aliasopt(SectionGroups)); cl::alias SectionGroupsShort("g", cl::desc("Alias for -elf-sections-groups"), - cl::aliasopt(SectionGroups)); + cl::aliasopt(SectionGroups), cl::NotHidden); // --elf-hash-histogram, --histogram, -I cl::opt HashHistogram( "elf-hash-histogram", cl::desc("Display bucket list histogram for hash sections")); cl::alias HashHistogramShort("I", cl::desc("Alias for -elf-hash-histogram"), - cl::aliasopt(HashHistogram)); + cl::aliasopt(HashHistogram), cl::NotHidden); cl::alias HistogramAlias("histogram", cl::desc("Alias for --elf-hash-histogram"), cl::aliasopt(HashHistogram));