summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Teubner <carlo@cteubner.net>2022-03-30 19:25:18 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-30 19:54:11 (GMT)
commit93dce4b4bf698563e4a72f4c265bda82626447a1 (patch)
treeb79f6c4c49b3ff10e0070ed3a206189cba2cea21
parenta7b325e203a45f3c8d4a64fd3338079e0a14e250 (diff)
downloadCMake-93dce4b4bf698563e4a72f4c265bda82626447a1.zip
CMake-93dce4b4bf698563e4a72f4c265bda82626447a1.tar.gz
CMake-93dce4b4bf698563e4a72f4c265bda82626447a1.tar.bz2
string(JSON): fix error message on invalid mode
The `GET_ARRAY` and `MEMBERS` modes were removed during development and review of commit 8eab76eb84 (string(JSON): Adds JSON parsing support to the string command, 2020-08-24, v3.19.0-rc1~159^2), but were accidentally left in an error message.
-rw-r--r--Source/cmStringCommand.cxx4
-rw-r--r--Tests/RunCMake/string/JSONWrongMode-stderr.txt2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index e5935b8..900854e 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -1106,8 +1106,8 @@ bool HandleJSONCommand(std::vector<std::string> const& arguments,
mode != "EQUAL"_s) {
throw json_error(
{ "got an invalid mode '"_s, mode,
- "', expected one of GET, GET_ARRAY, TYPE, MEMBER, MEMBERS,"
- " LENGTH, REMOVE, SET, EQUAL"_s });
+ "', expected one of GET, TYPE, MEMBER, LENGTH, REMOVE, SET, "
+ " EQUAL"_s });
}
const auto& jsonstr = args.PopFront("missing json string argument"_s);
diff --git a/Tests/RunCMake/string/JSONWrongMode-stderr.txt b/Tests/RunCMake/string/JSONWrongMode-stderr.txt
index c70991b..5668303 100644
--- a/Tests/RunCMake/string/JSONWrongMode-stderr.txt
+++ b/Tests/RunCMake/string/JSONWrongMode-stderr.txt
@@ -1,5 +1,5 @@
CMake Error at JSONWrongMode.cmake:1 \(string\):
string sub-command JSON got an invalid mode 'FOO', expected one of GET,
- GET_ARRAY, TYPE, MEMBER, MEMBERS, LENGTH, REMOVE, SET, EQUAL.
+ TYPE, MEMBER, LENGTH, REMOVE, SET, EQUAL.
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)