diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-06-02 11:03:21 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-06-02 11:06:11 -0700 |
commit | 5b460fb15e8bcd4b5f5ffad253b68aa2bc274049 (patch) | |
tree | ab7d28ef67fe4a16df673b25efc52d35d108097d /llvm/lib/Support/CommandLine.cpp | |
parent | cdd30542551a4c1af64b819f50982f197b61e28e (diff) | |
download | llvm-5b460fb15e8bcd4b5f5ffad253b68aa2bc274049.zip llvm-5b460fb15e8bcd4b5f5ffad253b68aa2bc274049.tar.gz llvm-5b460fb15e8bcd4b5f5ffad253b68aa2bc274049.tar.bz2 |
[llvm-dwarfdump] Print [=<offset>] after --debug-* options in help output.
Some of the --debug-* options can take an optional offset. Although the
man page does a good job of making that clear, it's much harder to
discover from the help output.
Currently the only reference to this is the following sentence:
> Where applicable these parameters take an optional =<offset> argument
> to dump only the entry at the specified offset.
This patch changes the help output from to print [=<offset>] after the
options that take an offset.
--debug-info[=<offset>] - Dump the .debug_info section
rdar://problem/63150066
Differential revision: https://reviews.llvm.org/D80959
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 25612b7e..52053df 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1778,9 +1778,10 @@ void basic_parser_impl::printOptionInfo(const Option &O, if (!ValName.empty()) { if (O.getMiscFlags() & PositionalEatsArgs) { outs() << " <" << getValueStr(O, ValName) << ">..."; - } else { + } else if (O.getValueExpectedFlag() == ValueOptional) + outs() << "[=<" << getValueStr(O, ValName) << ">]"; + else outs() << "=<" << getValueStr(O, ValName) << '>'; - } } Option::printHelpStr(O.HelpStr, GlobalWidth, getOptionWidth(O)); |