This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 5e9919e7a [#5853] improvement(CLI): Make the entity and arguments 
case-insensitive (#5898)
5e9919e7a is described below

commit 5e9919e7a44ff9e9591bf551a4d84407ef649a75
Author: Lord of Abyss <103809695+abyss-l...@users.noreply.github.com>
AuthorDate: Wed Dec 18 16:53:03 2024 +0800

    [#5853] improvement(CLI): Make the entity and arguments case-insensitive 
(#5898)
    
    ### What changes were proposed in this pull request?
    
    Make the entity and arguments case-insensitive.
    
    ### Why are the changes needed?
    
    Fix: #5853
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    ```bash
    bin/gcli.sh metalake List
    # output: correct output
    
    bin/gcli.sh Metalake list
    # output: correct output
    
    bin/gcli.sh mEtalake List
    # output: correct output
    ```
---
 clients/cli/src/main/java/org/apache/gravitino/cli/Main.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/Main.java 
b/clients/cli/src/main/java/org/apache/gravitino/cli/Main.java
index 8b610511f..4707da16d 100644
--- a/clients/cli/src/main/java/org/apache/gravitino/cli/Main.java
+++ b/clients/cli/src/main/java/org/apache/gravitino/cli/Main.java
@@ -19,6 +19,7 @@
 
 package org.apache.gravitino.cli;
 
+import java.util.Locale;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -70,7 +71,7 @@ public class Main {
     String[] args = line.getArgs();
 
     if (args.length == 2) {
-      String action = args[1];
+      String action = args[1].toLowerCase(Locale.ENGLISH);
       if (CommandActions.isValidCommand(action)) {
         return action;
       }
@@ -96,7 +97,7 @@ public class Main {
     String[] args = line.getArgs();
 
     if (args.length >= 1) {
-      String entity = args[0];
+      String entity = args[0].toLowerCase(Locale.ENGLISH);
       if (CommandEntities.isValidEntity(entity)) {
         return entity;
       } else {

Reply via email to