llvm.org GIT mirror llvm / 9cce93f
[llvm-dwarfdump] Remove unnecessary explicit -h behaviour --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. Reviewed by: hintonda Differential Revision: https://reviews.llvm.org/D63565 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364029 91177308-0d34-0410-b5e6-96231b3b80d8 James Henderson 3 months ago
3 changed file(s) with 4 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
11 # RUN: llvm-readobj --help-hidden %t | FileCheck --check-prefix=CHECK-READOBJ %s
22 # RUN: llvm-tblgen --help-hidden %t | FileCheck --check-prefix=CHECK-TBLGEN %s
33 # RUN: llvm-opt-report --help-hidden %t | FileCheck --check-prefix=CHECK-OPT-RPT %s
4 # RUN: llvm-dwarfdump --help-hidden %t | FileCheck --check-prefix=CHECK-DWARF %s
5 # RUN: llvm-dwarfdump -h %t | FileCheck --check-prefix=CHECK-DWARF-H %s
6
74
85 # CHECK-OBJDUMP: -h - Alias for --section-headers
96 # CHECK-READOBJ: -h - Alias for --file-headers
107 # CHECK-TBLGEN: -h - Alias for --help
118 # CHECK-OPT-RPT: -h - Alias for --help
12 # CHECK-DWARF: -h - Alias for -help
13
14 # llvm-dwarfdump declares `-h` option and prints special help in that case,
15 # which is weird, but makes for a good test, i.e., shows the default `-h`
16 # wasn't used.
17 # CHECK-DWARF-H-NOT: --help-list - Display list of available options (--help-list-hidden for more)
22 HELP: USAGE: llvm-dwarfdump{{[^ ]*}} [options]
33 HELP: Color Options
44 HELP: -color
5 HELP: Generic Options
6 HELP: -help
7 HELP: -help-list
8 HELP: -version
59 HELP: Section-specific Dump Options
610 HELP: -debug-info - Dump the .debug_info section
711 HELP: -eh-frame
9191 using namespace cl;
9292
9393 OptionCategory DwarfDumpCategory("Specific Options");
94 static opt Help("h", desc("Alias for -help"), Hidden,
95 cat(DwarfDumpCategory));
9694 static list
9795 InputFilenames(Positional, desc(""),
9896 ZeroOrMore, cat(DwarfDumpCategory));
574572 "pretty-print DWARF debug information in object files"
575573 " and debug info archives.\n");
576574
577 if (Help) {
578 PrintHelpMessage(/*Hidden =*/false, /*Categorized =*/true);
579 return 0;
580 }
581
582575 // FIXME: Audit interactions between these two options and make them
583576 // compatible.
584577 if (Diff && Verbose) {