Abyss-lord commented on code in PR #6091:
URL: https://github.com/apache/gravitino/pull/6091#discussion_r1902523207


##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -221,21 +218,28 @@ private void handleMetalakeCommand() {
         }
         if (line.hasOption(GravitinoOptions.ENABLE)) {
           boolean enableAllCatalogs = line.hasOption(GravitinoOptions.ALL);
-          newMetalakeEnable(url, ignore, metalake, enableAllCatalogs).handle();
+          newMetalakeEnable(url, ignore, metalake, 
enableAllCatalogs).validate().handle();
+          break;
         }
         if (line.hasOption(GravitinoOptions.DISABLE)) {
-          newMetalakeDisable(url, ignore, metalake).handle();
+          newMetalakeDisable(url, ignore, metalake).validate().handle();
+          break;
         }
 
         if (line.hasOption(GravitinoOptions.COMMENT)) {
           comment = line.getOptionValue(GravitinoOptions.COMMENT);
-          newUpdateMetalakeComment(url, ignore, metalake, comment).handle();
+          newUpdateMetalakeComment(url, ignore, metalake, 
comment).validate().handle();
+          break;
         }
         if (line.hasOption(GravitinoOptions.RENAME)) {
           String newName = line.getOptionValue(GravitinoOptions.RENAME);
           force = line.hasOption(GravitinoOptions.FORCE);
-          newUpdateMetalakeName(url, ignore, force, metalake, 
newName).handle();
+          newUpdateMetalakeName(url, ignore, force, metalake, 
newName).validate().handle();
+          break;
         }
+
+        System.err.println("The command does nothing.");
+        Main.exit(-1);

Review Comment:
   @justinmclean , hi Justin, Whether the user should be prompted if no action 
is taken?
   



##########
clients/cli/src/test/java/org/apache/gravitino/cli/TestFulllName.java:
##########
@@ -224,16 +224,4 @@ public void testGetMetalake() throws ParseException {
     String metalakeName = fullName.getMetalakeName();
     assertEquals(metalakeName, "demo_metalake");
   }
-
-  @Test
-  @SuppressWarnings("DefaultCharset")
-  public void testGetMetalakeWithoutMetalakeOption() throws ParseException {
-    String[] args = {"table", "list", "-i", "--name", "Hive_catalog.default"};
-    CommandLine commandLine = new DefaultParser().parse(options, args);
-    FullName fullName = new FullName(commandLine);
-    String metalakeName = fullName.getMetalakeName();
-    assertNull(metalakeName);
-    String errOutput = new String(errContent.toByteArray(), 
StandardCharsets.UTF_8).trim();
-    assertEquals(errOutput, ErrorMessages.MISSING_METALAKE);
-  }

Review Comment:
   @justinmclean , This test case is redundant with Test `entityNotFound`.



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