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:
@@ -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":
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user