jihuayu opened a new pull request, #3387:
URL: https://github.com/apache/kvrocks/pull/3387

   I have introduced the [subcommand 
framework](https://github.com/apache/kvrocks/discussions/3382) while making 
every effort to avoid modifying the existing command registration and execution 
logic. I plan to wait until the subcommand functionality is stable and fully 
migrated before performing a unified refactoring.
   
   Currently, I have modified the namespace command as a reference example.
   
   ## Some important 
   
   1. New concept Subcommand Family: Organizes a root command and its multiple 
subcommands into a single command group. A command family consists of three 
parts: the root command name, the subcommand parser, and the subcommand table.
   
   2. New concept ResolvedCommand (Subcommand Resolution Result): Instead of 
simply identifying the "first token input by the user," this explicitly 
distinguishes between the "root command" and the "actual command to be 
executed." For example, NAMESPACE ADD would be resolved as root = namespace, 
with the final command being namespace|add.
   
   3. New concept Canonical Name: Introduces a unified internal naming 
convention root|sub for subcommands (e.g., namespace|add). This name is used 
for internal capabilities such as COMMAND INFO, profiling, and statistics, 
removing the dependency on the raw input text.
   
   4. Registration-time Conflict Prevention: Adds startup-time validation for 
scenarios such as duplicate command family registration, duplicate subcommand 
registration, or parent-child command mismatches to prevent silent overrides.


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