Avoid cutting policy name in admin policy list command (#4241)

`mc admin policy list` only shows policy names, it does not need
 to cut the policy name to 20 characters when showing it.
This commit is contained in:
Anis Elleuch
2022-09-09 03:47:41 -07:00
committed by GitHub
parent 30a9bb8b05
commit 3142b54cc1
2 changed files with 2 additions and 7 deletions
+1 -5
View File
@@ -92,11 +92,7 @@ func (u userPolicyMessage) String() string {
fatalIf(probe.NewError(e), "Unable to marshal to JSON.")
return string(buf)
case "list":
policyFieldMaxLen := 20
// Create a new pretty table with cols configuration
return newPrettyTable(" ",
Field{"Policy", policyFieldMaxLen},
).buildRow(u.Policy)
return console.Colorize("PolicyName", u.Policy)
case "remove":
return console.Colorize("PolicyMessage", "Removed policy `"+u.Policy+"` successfully.")
case "add":
+1 -2
View File
@@ -57,8 +57,7 @@ func checkAdminPolicyListSyntax(ctx *cli.Context) {
func mainAdminPolicyList(ctx *cli.Context) error {
checkAdminPolicyListSyntax(ctx)
console.SetColor("PolicyMessage", color.New(color.FgGreen))
console.SetColor("Policy", color.New(color.FgBlue))
console.SetColor("PolicyName", color.New(color.FgBlue))
// Get the alias parameter from cli
args := ctx.Args()