Skip to content

Commit

Permalink
[#5853] improvement(CLI): Make the entity and arguments case-insensit…
Browse files Browse the repository at this point in the history
…ive (#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
```
  • Loading branch information
Abyss-lord authored Dec 18, 2024
1 parent c727df5 commit 5e9919e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clients/cli/src/main/java/org/apache/gravitino/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,7 +71,7 @@ protected static String resolveCommand(CommandLine line) {
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;
}
Expand All @@ -96,7 +97,7 @@ protected static String resolveEntity(CommandLine line) {
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 {
Expand Down

0 comments on commit 5e9919e

Please sign in to comment.