PragmaTwice commented on code in PR #1047:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1047#discussion_r1006368975


##########
src/config/config.cc:
##########
@@ -723,7 +726,13 @@ void Config::Get(std::string key, std::vector<std::string> 
*values) {
   for (const auto &iter : fields_) {
     if (key == "*" || Util::ToLower(key) == iter.first) {
       values->emplace_back(iter.first);
-      values->emplace_back(iter.second->ToString());
+      if (iter.second->GetConfigType() == configType::MultiConfig) {
+        for (const auto &p : Util::Split(iter.second->ToString(), "\n")) {
+          values->push_back(p);
+        }
+      } else {
+        values->emplace_back(iter.second->ToString());
+      }

Review Comment:
   ```suggestion
         if (iter.second->GetConfigType() == configType::MultiConfig) {
           for (const auto &p : Util::Split(iter.second->ToString(), "\n")) {
             values->emplace_back(iter.first);
             values->push_back(p);
           }
         } else {
           values->emplace_back(iter.first);
           values->emplace_back(iter.second->ToString());
         }
   ```
   I think we need to keep one-key-one-value pairs, in order to make user to 
parse the result of `config get *` easily.



##########
src/config/config.cc:
##########
@@ -723,7 +726,13 @@ void Config::Get(std::string key, std::vector<std::string> 
*values) {
   for (const auto &iter : fields_) {
     if (key == "*" || Util::ToLower(key) == iter.first) {
       values->emplace_back(iter.first);

Review Comment:
   ```suggestion
   ```



-- 
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