Skip to content

Commit

Permalink
[apache#5929] improvement(CLI): fix cli details command produce no ou…
Browse files Browse the repository at this point in the history
…tput (apache#5941)

### What changes were proposed in this pull request?

If a user has no roles then no output is produced from `user\group
details` command, it should give some help information.

### Why are the changes needed?

Fix: apache#5929 

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

```bash
bin/gcli.sh user details -m demo_metalake --user test_user
# output: User has no roles.

bin/gcli.sh group details -m demo_metalake --group group_no_role
# output: Groups has no roles.
```

---------

Co-authored-by: Qiming Teng <tengqm@outlook.com>
Abyss-lord and tengqm authored Dec 23, 2024
1 parent af3930d commit 66eb83b
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ public void handle() {
exitWithError(exp.getMessage());
}

String all = String.join(",", roles);
String all = roles.isEmpty() ? "The group has no roles." : String.join(",", roles);

System.out.println(all.toString());
}
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ public void handle() {
exitWithError(exp.getMessage());
}

String all = String.join(",", roles);
String all = roles.isEmpty() ? "The user has no roles." : String.join(",", roles);

System.out.println(all.toString());
}

0 comments on commit 66eb83b

Please sign in to comment.