Shuo-Jia commented on a change in pull request #605:
URL: https://github.com/apache/incubator-pegasus/pull/605#discussion_r493217704



##########
File path: src/shell/commands/detect_hotkey.cpp
##########
@@ -0,0 +1,116 @@
+#include "shell/commands.h"
+#include "shell/argh.h"
+#include "server/pegasus_read_service.h"
+
+bool validate_cmd(const argh::parser &cmd, const std::set<std::string> &params)
+{
+    if (cmd.size() > 1) {
+        fmt::print(stderr, "too many params!\n");
+        return false;
+    }
+
+    for (const auto &param : cmd.params()) {
+        if (params.find(param.first) == params.end()) {
+            fmt::print(stderr, "unknown param {} = {}\n", param.first, 
param.second);
+            return false;
+        }
+    }
+
+    return true;
+}

Review comment:
       The code is repeated with `disk_rebalance.cpp`, you can move it to 
`command_helper.h`




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to