sunxiaojian commented on code in PR #5641:
URL: https://github.com/apache/gravitino/pull/5641#discussion_r1855404091


##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -432,10 +433,14 @@ protected void handleTagCommand() {
     String url = getUrl();
     FullName name = new FullName(line);
     String metalake = name.getMetalakeName();
-    String tag = line.getOptionValue(GravitinoOptions.TAG);
-
+    String[] tags =
+        
Arrays.stream(line.getOptionValues(GravitinoOptions.TAG)).distinct().toArray(String[]::new);
+    if (!validateMultipleTagOption(tags)) {
+      System.err.println(ErrorMessages.MULTIPLE_TAG_COMMAND_ERROR);
+      return;
+    }
     if (CommandActions.DETAILS.equals(command)) {
-      new TagDetails(url, ignore, metalake, tag).handle();
+      new TagDetails(url, ignore, metalake, tags[0]).handle();

Review Comment:
   > There is no guarantee that tags is not empty.
   
   fixed



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