summaryrefslogtreecommitdiff
path: root/Source/cmCommandLineArgument.h
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-05-13 09:33:30 -0400
committerRobert Maynard <rmaynard@nvidia.com>2021-05-13 09:33:30 -0400
commitf78b167a2364d81fe8effab5face0ff888f6d9c2 (patch)
treea7e2d36c01ca6484c41b0892eefb4fc247e65794 /Source/cmCommandLineArgument.h
parent5aa0dec6b011c74225f4af895922edd10db09607 (diff)
downloadcmake-f78b167a2364d81fe8effab5face0ff888f6d9c2.tar.gz
cmCommandLineArgument: Provide more information syntax error messages
Diffstat (limited to 'Source/cmCommandLineArgument.h')
-rw-r--r--Source/cmCommandLineArgument.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmCommandLineArgument.h b/Source/cmCommandLineArgument.h
index f4153fcbff..ddfff32f6f 100644
--- a/Source/cmCommandLineArgument.h
+++ b/Source/cmCommandLineArgument.h
@@ -25,7 +25,7 @@ struct cmCommandLineArgument
template <typename FunctionType>
cmCommandLineArgument(std::string n, Values t, FunctionType&& func)
- : InvalidSyntaxMessage(cmStrCat("Invalid syntax used with ", n))
+ : InvalidSyntaxMessage(cmStrCat(" is invalid syntax for ", n))
, InvalidValueMessage(cmStrCat("Invalid value used with ", n))
, Name(std::move(n))
, Type(t)
@@ -36,7 +36,7 @@ struct cmCommandLineArgument
template <typename FunctionType>
cmCommandLineArgument(std::string n, std::string failedMsg, Values t,
FunctionType&& func)
- : InvalidSyntaxMessage(cmStrCat("Invalid syntax used with ", n))
+ : InvalidSyntaxMessage(cmStrCat(" is invalid syntax for ", n))
, InvalidValueMessage(std::move(failedMsg))
, Name(std::move(n))
, Type(t)
@@ -150,7 +150,8 @@ struct cmCommandLineArgument
}
if (parseState == ParseMode::SyntaxError) {
- cmSystemTools::Error(this->InvalidSyntaxMessage);
+ cmSystemTools::Error(
+ cmStrCat("'", input, "'", this->InvalidSyntaxMessage));
} else if (parseState == ParseMode::ValueError) {
cmSystemTools::Error(this->InvalidValueMessage);
}