aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-07-14 01:28:28 -0700
committerFangrui Song <i@maskray.me>2022-07-14 01:28:28 -0700
commit52cb972537dac7ac535b57ba9399d53549c027e8 (patch)
treec47af87d584ac6ece835a518ba1dc481a1172c66 /llvm/lib/Support/CommandLine.cpp
parent6e6be5f9504d3de7a5e94bdc3c8ba96d2f6a88a8 (diff)
downloadllvm-52cb972537dac7ac535b57ba9399d53549c027e8.zip
llvm-52cb972537dac7ac535b57ba9399d53549c027e8.tar.gz
llvm-52cb972537dac7ac535b57ba9399d53549c027e8.tar.bz2
[CommandLine] --help: print "-o <xxx>" instead of "-o=<xxx>"
Accepting -o= is a quirk of CommandLine. For --help, we should print the conventional "-o <xxx>".
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index eb6c04d..e3df172 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1862,8 +1862,10 @@ void basic_parser_impl::printOptionInfo(const Option &O,
outs() << " <" << getValueStr(O, ValName) << ">...";
} else if (O.getValueExpectedFlag() == ValueOptional)
outs() << "[=<" << getValueStr(O, ValName) << ">]";
- else
- outs() << "=<" << getValueStr(O, ValName) << '>';
+ else {
+ outs() << (O.ArgStr.size() == 1 ? " <" : "=<") << getValueStr(O, ValName)
+ << '>';
+ }
}
Option::printHelpStr(O.HelpStr, GlobalWidth, getOptionWidth(O));