[PATCH] D81907: [llvm-objcopy] Fix help text for install-name-tool

Sameer Arora via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 22:00:14 PDT 2020


sameerarora101 created this revision.
sameerarora101 added reviewers: alexshap, jhenderson, Ktwu, smeenai.
Herald added subscribers: llvm-commits, abrachet, MaskRay.
Herald added a reviewer: rupprecht.
Herald added a project: LLVM.
sameerarora101 edited the summary of this revision.

Remove `[output]` string from the USAGE message for install-name-tool.
Keep `[output]` only for objcopy and strip. For reference: the issue is 
highlighted in comments under https://reviews.llvm.org/D81527.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81907

Files:
  llvm/test/tools/llvm-objcopy/MachO/install-name-tool-help-message.test
  llvm/tools/llvm-objcopy/CopyConfig.cpp


Index: llvm/tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- llvm/tools/llvm-objcopy/CopyConfig.cpp
+++ llvm/tools/llvm-objcopy/CopyConfig.cpp
@@ -395,7 +395,8 @@
 
 static void printHelp(const opt::OptTable &OptTable, raw_ostream &OS,
                       StringRef ToolName) {
-  OptTable.PrintHelp(OS, (ToolName + " input [output]").str().c_str(),
+  StringRef Output = ToolName == "llvm-install-name-tool" ? "" : " [output]";
+  OptTable.PrintHelp(OS, (ToolName + " input" + Output).str().c_str(),
                      (ToolName + " tool").str().c_str());
   // TODO: Replace this with libOption call once it adds extrahelp support.
   // The CommandLine library has a cl::extrahelp class to support this,
Index: llvm/test/tools/llvm-objcopy/MachO/install-name-tool-help-message.test
===================================================================
--- llvm/test/tools/llvm-objcopy/MachO/install-name-tool-help-message.test
+++ llvm/test/tools/llvm-objcopy/MachO/install-name-tool-help-message.test
@@ -1,10 +1,10 @@
-# RUN: llvm-install-name-tool -h | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s
-# RUN: llvm-install-name-tool --help | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s
-# RUN: not llvm-install-name-tool 2>&1 | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s
+# RUN: llvm-install-name-tool -h | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s --match-full-lines
+# RUN: llvm-install-name-tool --help | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s --match-full-lines
+# RUN: not llvm-install-name-tool 2>&1 | FileCheck --check-prefix=INSTALL-NAME-TOOL-USAGE %s --match-full-lines
 # RUN: not llvm-install-name-tool -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
 # RUN: not llvm-install-name-tool --abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
 
-# INSTALL-NAME-TOOL-USAGE: USAGE: llvm-install-name-tool
-# INSTALL-NAME-TOOL-USAGE: @FILE
+# INSTALL-NAME-TOOL-USAGE: USAGE: llvm-install-name-tool input
+# INSTALL-NAME-TOOL-USAGE: Pass @FILE as argument to read options from FILE.
 
 # UNKNOWN-ARG: unknown argument '{{-+}}abcabc'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81907.270957.patch
Type: text/x-patch
Size: 2156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200616/9a8cb7bd/attachment.bin>


More information about the llvm-commits mailing list