git-hulk commented on code in PR #1704:
URL: https://github.com/apache/kvrocks/pull/1704#discussion_r1306592522
##########
src/commands/cmd_stream.cc:
##########
@@ -205,6 +205,97 @@ class CommandXDel : public Commander {
std::vector<redis::StreamEntryID> ids_;
};
+class CommandXGroup : public Commander {
+ public:
+ Status Parse(const std::vector<std::string> &args) override {
+ subcommand_ = util::ToLower(args[1]);
+ stream_name_ = args[2];
+ group_name_ = args[3];
+ if (std::isdigit(group_name_[0])) {
+ return {Status::RedisParseErr, "group name cannot start with number"};
+ }
+
+ if (subcommand_ == "create") {
+ if (args.size() < 5 || args.size() > 8) {
+ return {Status::RedisParseErr, errWrongNumOfArguments};
+ }
+
+ xgroup_create_options_.last_id = args[4];
+
+ for (size_t i = 5; i < args.size(); ++i) {
Review Comment:
it'd be better to use `command_parser` to parse arguments.
--
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]