pluralize match if total == 1

This commit is contained in:
UmairShahzad 2020-02-27 01:44:35 +05:00
parent 3c687ed111
commit 0c9909c230

View file

@ -32,7 +32,11 @@ func getTitle(cmd *cobra.Command, cmdType string, matchCount int, totalMatchCoun
title = "\nShowing %d of %s in %s"
if (!limitSet && userSetFlagCounter > 0) || (userSetFlagCounter > 1) {
title += " that match your search\n\n"
matchStr := "match"
if totalMatchCount == 1 {
matchStr = "matches"
}
title += fmt.Sprintf(" that %s your search\n\n", matchStr)
} else {
title += "\n\n"
}