mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-17 07:11:52 +08:00
cmCommandLineArgument: Provide more information syntax error messages
This commit is contained in:
@@ -25,7 +25,7 @@ struct cmCommandLineArgument
|
|||||||
|
|
||||||
template <typename FunctionType>
|
template <typename FunctionType>
|
||||||
cmCommandLineArgument(std::string n, Values t, FunctionType&& func)
|
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))
|
, InvalidValueMessage(cmStrCat("Invalid value used with ", n))
|
||||||
, Name(std::move(n))
|
, Name(std::move(n))
|
||||||
, Type(t)
|
, Type(t)
|
||||||
@@ -36,7 +36,7 @@ struct cmCommandLineArgument
|
|||||||
template <typename FunctionType>
|
template <typename FunctionType>
|
||||||
cmCommandLineArgument(std::string n, std::string failedMsg, Values t,
|
cmCommandLineArgument(std::string n, std::string failedMsg, Values t,
|
||||||
FunctionType&& func)
|
FunctionType&& func)
|
||||||
: InvalidSyntaxMessage(cmStrCat("Invalid syntax used with ", n))
|
: InvalidSyntaxMessage(cmStrCat(" is invalid syntax for ", n))
|
||||||
, InvalidValueMessage(std::move(failedMsg))
|
, InvalidValueMessage(std::move(failedMsg))
|
||||||
, Name(std::move(n))
|
, Name(std::move(n))
|
||||||
, Type(t)
|
, Type(t)
|
||||||
@@ -150,7 +150,8 @@ struct cmCommandLineArgument
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parseState == ParseMode::SyntaxError) {
|
if (parseState == ParseMode::SyntaxError) {
|
||||||
cmSystemTools::Error(this->InvalidSyntaxMessage);
|
cmSystemTools::Error(
|
||||||
|
cmStrCat("'", input, "'", this->InvalidSyntaxMessage));
|
||||||
} else if (parseState == ParseMode::ValueError) {
|
} else if (parseState == ParseMode::ValueError) {
|
||||||
cmSystemTools::Error(this->InvalidValueMessage);
|
cmSystemTools::Error(this->InvalidValueMessage);
|
||||||
}
|
}
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
^CMake Error: Invalid syntax used with --target
|
^CMake Error: '--target=invalid' is invalid syntax for --target
|
||||||
Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
|
Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
^CMake Error: Invalid syntax used with --target
|
^CMake Error: '--targetinvalid' is invalid syntax for --target
|
||||||
Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
|
Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
|
||||||
|
Reference in New Issue
Block a user