shaofengshi commented on code in PR #5161:
URL: https://github.com/apache/gravitino/pull/5161#discussion_r1833946677


##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -367,6 +381,55 @@ protected void handleGroupCommand() {
     }
   }
 
+  /** Handles the command execution for Tags based on command type and the 
command line options. */
+  protected void handleTagCommand() {
+    String url = getUrl();
+    FullName name = new FullName(line);
+    String metalake = name.getMetalakeName();
+    String tag = line.getOptionValue(GravitinoOptions.TAG);
+
+    if (CommandActions.DETAILS.equals(command)) {
+      new TagDetails(url, ignore, metalake, tag).handle();
+    } else if (CommandActions.LIST.equals(command)) {
+      if (!name.hasCatalogName()) {
+        new ListAllTags(url, ignore, metalake).handle();
+      } else {
+        new ListEntityTags(url, ignore, metalake, name).handle();
+      }
+    } else if (CommandActions.CREATE.equals(command)) {
+      String comment = line.getOptionValue(GravitinoOptions.COMMENT);
+      new CreateTag(url, ignore, metalake, tag, comment).handle();
+    } else if (CommandActions.DELETE.equals(command)) {
+      new DeleteTag(url, ignore, metalake, tag).handle();
+    } else if (CommandActions.SET.equals(command)) {
+      String property = line.getOptionValue(GravitinoOptions.PROPERTY);
+      String value = line.getOptionValue(GravitinoOptions.VALUE);
+      if (property != null && value != null) {

Review Comment:
   Here the logic is a little complex: when use the "set" command for tag, if 
"--name" and "--property --value" options appeared on the same time, you will 
set the property/value, and ignore the entity of "--name". This is why I 
propose to use "set-tag" or "set-property" command instead of a "set" command. 
Otherwise we'd better make the document clear on the logic. What do you think?



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