mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
file(DOWNLOAD|UPLOAD): Warn on unexpected arguments
Emit warning message on unparsed argument instead of silently ignoring it. Can't stop with the error message because it may break old code.
This commit is contained in:
@@ -2564,6 +2564,11 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
|
||||
return false;
|
||||
}
|
||||
hashMatchMSG = algo + " hash";
|
||||
} else {
|
||||
// Do not return error for compatibility reason.
|
||||
std::string err = "Unexpected argument: ";
|
||||
err += *i;
|
||||
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str());
|
||||
}
|
||||
++i;
|
||||
}
|
||||
@@ -2812,6 +2817,11 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
|
||||
statusVar = *i;
|
||||
} else if (*i == "SHOW_PROGRESS") {
|
||||
showProgress = true;
|
||||
} else {
|
||||
// Do not return error for compatibility reason.
|
||||
std::string err = "Unexpected argument: ";
|
||||
err += *i;
|
||||
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str());
|
||||
}
|
||||
|
||||
++i;
|
||||
|
||||
Reference in New Issue
Block a user