[llvm-readobj] Make some commonly used short options visibile in -help

For people who use llvm-readelf as a replacement of GNU readelf, they would like to see -d -r ... listed in llvm-readelf -help. It also helps understanding the confusing -s (which is unfortunately different in semantics).

Reviewers: phosek, ruiu, echristo

Reviewed By: ruiu, echristo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D52129

llvm-svn: 342339
This commit is contained in:
Fangrui Song 2018-09-15 21:27:46 +00:00
parent a1981c757b
commit 37a72098ae
1 changed files with 9 additions and 0 deletions

View File

@ -594,6 +594,15 @@ int main(int argc, const char *argv[]) {
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
// Make some commonly used short options visibile in -help.
opts::DynamicTableShort.setHiddenFlag(cl::NotHidden);
opts::FileHeadersShort.setHiddenFlag(cl::NotHidden);
opts::ProgramHeadersShort.setHiddenFlag(cl::NotHidden);
opts::RelocationsShort.setHiddenFlag(cl::NotHidden);
opts::SectionsShort.setHiddenFlag(cl::NotHidden);
opts::SectionsShortUpper.setHiddenFlag(cl::NotHidden);
opts::SymbolsShort.setHiddenFlag(cl::NotHidden);
opts::WideOutput.setHiddenFlag(cl::Hidden);
if (sys::path::stem(argv[0]).find("readelf") != StringRef::npos)