PragmaTwice commented on code in PR #1840:
URL: https://github.com/apache/kvrocks/pull/1840#discussion_r1365732007


##########
src/commands/cmd_json.cc:
##########
@@ -40,16 +43,57 @@ class CommandJsonSet : public Commander {
 
 class CommandJsonGet : public Commander {
  public:
+  Status Parse(const std::vector<std::string> &args) override {
+    CommandParser parser(args, 2);
+
+    while (parser.Good()) {
+      if (parser.EatEqICase("INDENT")) {
+        auto indent = GET_OR_RET(parser.TakeStr());
+
+        if (std::any_of(indent.begin(), indent.end(), [](char v) { return v != 
' '; })) {
+          return {Status::RedisParseErr, "Currently only all-space INDENT is 
supported"};
+        }
+
+        indent_size_ = indent.size();
+      } else if (parser.EatEqICase("NEWLINE")) {
+        new_line_chars_ = GET_OR_RET(parser.TakeStr());
+      } else if (parser.EatEqICase("SPACE")) {
+        auto space = GET_OR_RET(parser.TakeStr());
+
+        if (space != "" && space != " ") {
+          return {Status::RedisParseErr, "Currently only SPACE ' ' is 
supported"};

Review Comment:
   I think we do not need to emphasize it in error message. User can just do 
not pass this option.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to