diff --git a/Source/cmFileAPICommand.cxx b/Source/cmFileAPICommand.cxx index 6ea01cce9d..ca5389f421 100644 --- a/Source/cmFileAPICommand.cxx +++ b/Source/cmFileAPICommand.cxx @@ -68,7 +68,7 @@ bool handleQueryCommand(std::vector const& args, cmExecutionStatus& status) { if (args.empty()) { - status.SetError("QUERY subcommand called without required arguments."); + status.SetError("QUERY called without required arguments."); return false; } @@ -97,21 +97,20 @@ bool handleQueryCommand(std::vector const& args, return true; } if (!unparsedArguments.empty()) { - status.SetError("QUERY subcommand given unknown argument \"" + + status.SetError("QUERY given unknown argument \"" + unparsedArguments.front() + "\"."); return false; } if (!std::all_of(arguments.ApiVersion.begin(), arguments.ApiVersion.end(), isCharDigit)) { - status.SetError("QUERY subcommand given a non-integer API_VERSION."); + status.SetError("QUERY given non-integer API_VERSION."); return false; } int const apiVersion = std::atoi(arguments.ApiVersion.c_str()); if (apiVersion != 1) { status.SetError( - cmStrCat("QUERY subcommand given an unsupported API_VERSION \"", - arguments.ApiVersion, + cmStrCat("QUERY given unsupported API_VERSION \"", arguments.ApiVersion, "\" (the only currently supported version is 1).")); return false; } @@ -138,7 +137,7 @@ bool handleQueryCommand(std::vector const& args, if (!std::all_of(errors.begin(), errors.end(), [](std::string const& s) -> bool { return s.empty(); })) { - std::string message("QUERY subcommand was given invalid arguments:"); + std::string message("QUERY given invalid arguments:"); for (std::string const& s : errors) { if (!s.empty()) { message = cmStrCat(message, "\n ", s); diff --git a/Tests/RunCMake/FileAPI/ProjectQueryBad-stderr.txt b/Tests/RunCMake/FileAPI/ProjectQueryBad-stderr.txt index 84eff98b49..5e992b3a74 100644 --- a/Tests/RunCMake/FileAPI/ProjectQueryBad-stderr.txt +++ b/Tests/RunCMake/FileAPI/ProjectQueryBad-stderr.txt @@ -4,15 +4,15 @@ CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): .* Invalid API version checks CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): - cmake_file_api QUERY subcommand given an unsupported API_VERSION "2" \(the - only currently supported version is 1\)\. + cmake_file_api QUERY given unsupported API_VERSION "2" \(the only currently + supported version is 1\)\. .* CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): - cmake_file_api QUERY subcommand given a non-integer API_VERSION\. + cmake_file_api QUERY given non-integer API_VERSION\. .* Invalid version numbers check CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): - cmake_file_api QUERY subcommand was given invalid arguments: + cmake_file_api QUERY given invalid arguments: Given a malformed version "nope" for CODEMODEL\. Given a malformed version "-2" for CACHE\. @@ -21,7 +21,7 @@ CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): .* Requested versions too high check CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): - cmake_file_api QUERY subcommand was given invalid arguments: + cmake_file_api QUERY given invalid arguments: None of the specified CODEMODEL versions is supported by this version of CMake\. None of the specified CACHE versions is supported by this version of CMake\. @@ -30,7 +30,7 @@ CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): .* Requested versions too low check CMake Error at ProjectQueryBad\.cmake:[0-9]+ \(cmake_file_api\): - cmake_file_api QUERY subcommand was given invalid arguments: + cmake_file_api QUERY given invalid arguments: None of the specified CODEMODEL versions is supported by this version of CMake\. None of the specified CACHE versions is supported by this version of CMake\.