[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
This commit is contained in:
gbreynoo 2021-05-12 12:09:08 +01:00
parent 725bc3eb0d
commit 81900dc498
1 changed files with 11 additions and 10 deletions

View File

@ -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<bool>
@ -131,7 +131,8 @@ namespace opts {
// --notes, -n
cl::opt<bool> 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<bool> DynRelocs("dyn-relocations",
@ -166,9 +167,8 @@ namespace opts {
// --unwind, -u
cl::opt<bool> 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<bool> 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<std::string>
@ -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<bool> 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<bool> 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<bool> 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));