[ELF] - Print options aliases in --help
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 26 Jul 2017 09:21:10 +0000 (09:21 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 26 Jul 2017 09:21:10 +0000 (09:21 +0000)
This is PR30422,
previously LLD did not render all option aliases in --help.
With this patch it will.

Differential revision: https://reviews.llvm.org/D35477

llvm-svn: 309089

lld/ELF/DriverUtils.cpp
lld/test/ELF/help.s [new file with mode: 0644]

index a5876f8..463fa2a 100644 (file)
@@ -116,7 +116,8 @@ opt::InputArgList ELFOptTable::parse(ArrayRef<const char *> Argv) {
 
 void elf::printHelp(const char *Argv0) {
   ELFOptTable Table;
-  Table.PrintHelp(outs(), Argv0, "lld", false);
+  Table.PrintHelp(outs(), Argv0, "lld", false /*ShowHidden*/,
+                  true /*ShowAllAliases*/);
   outs() << "\n";
 
   // Scripts generated by Libtool versions up to at least 2.4.6 (the most
diff --git a/lld/test/ELF/help.s b/lld/test/ELF/help.s
new file mode 100644 (file)
index 0000000..2554531
--- /dev/null
@@ -0,0 +1,5 @@
+# RUN: ld.lld --help 2>&1 | FileCheck %s
+# CHECK:  OPTIONS:
+# CHECK:  --output=<value>        Path to file to write output
+# CHECK:  --output <value>        Path to file to write output
+# CHECK:  -o <path>               Path to file to write output