tengqm commented on code in PR #5921:
URL: https://github.com/apache/gravitino/pull/5921#discussion_r1892013962
##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -476,6 +476,16 @@ protected void handleUserCommand() {
Command.setAuthenticationMode(auth, userName);
+ if (CommandActions.LIST.equals(command)) {
+ newListUsers(url, ignore, metalake).handle();
+ return;
+ }
+
+ if (Objects.isNull(user)) {
+ System.err.println("User is undefined. Please use --user to specify a
user.");
+ return;
+ }
Review Comment:
I would do this in a different way:
```java
// A user is mandatory for all actions except for `list`.
if (Object.isNull(user) && !CommandActions.LIST.equals(command) {
System.err.println("....");
return;
}
```
The handler for `list` can be left as is.
--
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]