[PATCH] D63565: [llvm-dwarfdump] Remove unnecessary explicit -h behaviour
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 10:00:11 PDT 2019
jhenderson created this revision.
jhenderson added reviewers: probinson, dblaikie, JDevlieghere, aprantl.
Herald added a project: LLVM.
--help and -h are automatically supported by the command-line parser, unless overridden by the tool. The behaviour of the `PrintHelpMessage` being used for -h prior to this patch is subtly different to that provided by --help automatically (it omits certain elements of help text and options, such as --help-list), so overriding the default is not desirable, without good reason. This patch removes the explicit specification of -h and its behaviour, so that the default behaviour is used.
Repository:
rL LLVM
https://reviews.llvm.org/D63565
Files:
test/tools/llvm-dwarfdump/cmdline.test
tools/llvm-dwarfdump/llvm-dwarfdump.cpp
Index: tools/llvm-dwarfdump/llvm-dwarfdump.cpp
===================================================================
--- tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -92,8 +92,6 @@
using namespace cl;
OptionCategory DwarfDumpCategory("Specific Options");
-static opt<bool> Help("h", desc("Alias for -help"), Hidden,
- cat(DwarfDumpCategory));
static list<std::string>
InputFilenames(Positional, desc("<input object files or .dSYM bundles>"),
ZeroOrMore, cat(DwarfDumpCategory));
@@ -575,11 +573,6 @@
"pretty-print DWARF debug information in object files"
" and debug info archives.\n");
- if (Help) {
- PrintHelpMessage(/*Hidden =*/false, /*Categorized =*/true);
- return 0;
- }
-
// FIXME: Audit interactions between these two options and make them
// compatible.
if (Diff && Verbose) {
Index: test/tools/llvm-dwarfdump/cmdline.test
===================================================================
--- test/tools/llvm-dwarfdump/cmdline.test
+++ test/tools/llvm-dwarfdump/cmdline.test
@@ -3,6 +3,10 @@
HELP: USAGE: llvm-dwarfdump{{[^ ]*}} [options] <input object files or .dSYM bundles>
HELP: Color Options
HELP: -color
+HELP: Generic Options
+HELP: -help
+HELP: -help-list
+HELP: -version
HELP: Section-specific Dump Options
HELP: -debug-info - Dump the .debug_info section
HELP: -eh-frame
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63565.205623.patch
Type: text/x-patch
Size: 1442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190619/395e8123/attachment.bin>
More information about the llvm-commits
mailing list