summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandLineArgument.h
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-05-13 13:33:30 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2021-05-13 13:33:30 (GMT)
commitf78b167a2364d81fe8effab5face0ff888f6d9c2 (patch)
treea7e2d36c01ca6484c41b0892eefb4fc247e65794 /Source/cmCommandLineArgument.h
parent5aa0dec6b011c74225f4af895922edd10db09607 (diff)
downloadCMake-f78b167a2364d81fe8effab5face0ff888f6d9c2.zip
CMake-f78b167a2364d81fe8effab5face0ff888f6d9c2.tar.gz
CMake-f78b167a2364d81fe8effab5face0ff888f6d9c2.tar.bz2
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 f4153fc..ddfff32 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);
}