Simplify "missing argument" error message.

We do not have an option taking more than one arguments,
so we can just say "missing argument" instead of "missing argument(s)".

llvm-svn: 287454
This commit is contained in:
Rui Ueyama 2016-11-19 18:49:38 +00:00
parent fec2158292
commit 844c1c908c
3 changed files with 3 additions and 5 deletions

View File

@ -81,9 +81,7 @@ opt::InputArgList ELFOptTable::parse(ArrayRef<const char *> Argv) {
// Parse options and then do error checking.
Args = this->ParseArgs(Vec, MissingIndex, MissingCount);
if (MissingCount)
error(Twine("missing arg value for \"") + Args.getArgString(MissingIndex) +
"\", expected " + Twine(MissingCount) +
(MissingCount == 1 ? " argument.\n" : " arguments"));
error(Twine(Args.getArgString(MissingIndex)) + ": missing argument");
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
error("unknown argument: " + Arg->getSpelling());

View File

@ -230,7 +230,7 @@ _start:
# CANNOT_OPEN: cannot open {{.*}}.no.such.file: {{[Nn]}}o such file or directory
# RUN: not ld.lld %t -o 2>&1 | FileCheck --check-prefix=NO_O_VAL %s
# NO_O_VAL: missing arg value for "-o", expected 1 argument.
# NO_O_VAL: -o: missing argument
# RUN: not ld.lld --foo 2>&1 | FileCheck --check-prefix=UNKNOWN %s
# UNKNOWN: unknown argument: --foo

View File

@ -15,7 +15,7 @@
// Should fail if no library specified
// RUN: not ld.lld -l 2>&1 \
// RUN: | FileCheck --check-prefix=NOLIBRARY %s
// NOLIBRARY: missing arg value for "-l", expected 1 argument.
// NOLIBRARY: -l: missing argument
// Should link normally, because _bar is not used
// RUN: ld.lld -o %t3 %t.o