Skip to content

Commit 2974b3c

Browse files
committed
[llvm-dwarfdump] Make commandline arguments consistent.
Currently, llvm-dwarfdump's help message has two issues. 1. Most long options are printed in `--long-option`, except for some section dumping options, e.g., `-apple-names`, `-debug-addr`. 2. Most options are printed with consistent indention, except for some section dumping options. This patch helps resolve these two issues. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D79618
1 parent dbc9e1c commit 2974b3c

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

llvm/test/tools/llvm-dwarfdump/cmdline.test

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ RUN: llvm-dwarfdump -h 2>&1 | FileCheck --check-prefix=HELP %s --implicit-check-
22
RUN: llvm-dwarfdump --help 2>&1 | FileCheck --check-prefix=HELP %s --implicit-check-not=out-file
33
HELP: USAGE: llvm-dwarfdump{{[^ ]*}} [options] <input object files or .dSYM bundles>
44
HELP: Color Options
5-
HELP: -color
5+
HELP: --color
66
HELP: Generic Options
7-
HELP: -help
8-
HELP: -help-list
9-
HELP: -version
7+
HELP: --help
8+
HELP: --help-list
9+
HELP: --version
1010
HELP: Section-specific Dump Options
11-
HELP: -debug-info - Dump the .debug_info section
12-
HELP: -eh-frame
11+
HELP: --debug-info - Dump the .debug_info section
12+
HELP: --eh-frame
1313
HELP: Specific Options
14-
HELP: -diff
15-
HELP: -find
16-
HELP: -ignore-case
17-
HELP: -lookup
18-
HELP: -name
14+
HELP: --diff
15+
HELP: --find
16+
HELP: --ignore-case
17+
HELP: --lookup
18+
HELP: --name
1919
HELP: -o=<filename>
20-
HELP: -parent-recurse-depth=<N>
21-
HELP: -recurse-depth=<N>
22-
HELP: -regex
23-
HELP: -show-children
24-
HELP: -show-form
25-
HELP: -show-parents
26-
HELP: -statistics
27-
HELP: -summarize-types
20+
HELP: --parent-recurse-depth=<N>
21+
HELP: --recurse-depth=<N>
22+
HELP: --regex
23+
HELP: --show-children
24+
HELP: --show-form
25+
HELP: --show-parents
26+
HELP: --statistics
27+
HELP: --summarize-types
2828
HELP: @FILE
2929

3030
RUN: llvm-dwarfdump --version 2>&1 | FileCheck --check-prefix=VERSION %s

llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ class parser<OffsetOption> final : public basic_parser<OffsetOption> {
7272
return ValueOptional;
7373
}
7474

75-
void printOptionInfo(const Option &O, size_t GlobalWidth) const {
76-
outs() << " -" << O.ArgStr;
77-
Option::printHelpStr(O.HelpStr, GlobalWidth, getOptionWidth(O));
78-
}
75+
StringRef getValueName() const override { return StringRef(); }
7976

8077
void printOptionDiff(const Option &O, OffsetOption V, OptVal Default,
8178
size_t GlobalWidth) const {

0 commit comments

Comments
 (0)