Browse Source

Merge topic 'string-JSON-error-modes'

93dce4b4bf string(JSON): fix error message on invalid mode

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !7130
Brad King 3 years ago
parent
commit
7ae3c6740b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Source/cmStringCommand.cxx
  2. 1 1
      Tests/RunCMake/string/JSONWrongMode-stderr.txt

+ 2 - 2
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);

+ 1 - 1
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\)