Skip to content

Commit

Permalink
make output message more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Dec 22, 2016
1 parent 37b8a80 commit f8e1faa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/cmd/admin/policy/modify_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,11 @@ existingLoop:

// prints affirmative output for role modification commands
func printSuccessForCommand(role string, didAdd bool, targetName string, targets []string, isNamespaced bool, out io.Writer) {
preposition := "from"
verb := "removed"
clusterScope := " cluster "
clusterScope := "cluster "
allTargets := fmt.Sprintf("%q", targets)
if isNamespaced {
clusterScope = " "
clusterScope = ""
}
if len(targets) > 1 {
targetName = fmt.Sprintf("%ss", targetName)
Expand All @@ -436,8 +435,7 @@ func printSuccessForCommand(role string, didAdd bool, targetName string, targets
}
if didAdd {
verb = "added"
preposition = "to"
}

fmt.Fprintf(out, "Successfully %s the %q%srole %s %s %s.\n", verb, role, clusterScope, preposition, targetName, allTargets)
fmt.Fprintf(out, "%srole %q %s: %s\n", clusterScope, role, verb, allTargets)
}

0 comments on commit f8e1faa

Please sign in to comment.