summaryrefslogtreecommitdiffstats
path: root/Source/cmExecuteProcessCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-18 21:12:54 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-22 14:32:24 (GMT)
commite56108f629f0719429487b51ff952e80138949fa (patch)
tree0a22fd8fbaaeb58721b911a160552d6964570465 /Source/cmExecuteProcessCommand.cxx
parentb7c82b26b03349d1201a24acbe198ee1bd00ee3e (diff)
downloadCMake-e56108f629f0719429487b51ff952e80138949fa.zip
CMake-e56108f629f0719429487b51ff952e80138949fa.tar.gz
CMake-e56108f629f0719429487b51ff952e80138949fa.tar.bz2
cmExecuteProcessCommand: Report keyword errors via argument parser results
Diffstat (limited to 'Source/cmExecuteProcessCommand.cxx')
-rw-r--r--Source/cmExecuteProcessCommand.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index af56e2d..7fbd826 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -47,7 +47,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
return false;
}
- struct Arguments
+ struct Arguments : public ArgumentParser::ParseResult
{
std::vector<std::vector<std::string>> Commands;
std::string OutputVariable;
@@ -95,14 +95,10 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
.Bind("COMMAND_ERROR_IS_FATAL"_s, &Arguments::CommandErrorIsFatal);
std::vector<std::string> unparsedArguments;
- std::vector<cm::string_view> keywordsMissingValue;
- Arguments const arguments =
- parser.Parse(args, &unparsedArguments, &keywordsMissingValue);
+ Arguments const arguments = parser.Parse(args, &unparsedArguments);
- if (!keywordsMissingValue.empty()) {
- status.SetError(cmStrCat(" called with no value for ",
- keywordsMissingValue.front(), "."));
- return false;
+ if (arguments.MaybeReportError(status.GetMakefile())) {
+ return true;
}
if (!unparsedArguments.empty()) {
status.SetError(" given unknown argument \"" + unparsedArguments.front() +