From 11e04748b93621a7d377d3163381ff1f38e5fdbe Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Sat, 22 Dec 2018 04:36:32 +0100 Subject: Allow empty messages in comments. Some bug trackers, like Launchpad, allow messages to be empty (when adding a file to the bug, for instance). --- commands/show.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/show.go b/commands/show.go index 86c01a17..935f617c 100644 --- a/commands/show.go +++ b/commands/show.go @@ -58,6 +58,7 @@ func runShowBug(cmd *cobra.Command, args []string) error { indent := " " for i, comment := range snapshot.Comments { + var message string fmt.Printf("%s#%d %s <%s>\n\n", indent, i, @@ -65,9 +66,15 @@ func runShowBug(cmd *cobra.Command, args []string) error { comment.Author.Email, ) + if comment.Message == "" { + message = colors.GreyBold("No description provided.") + } else { + message = comment.Message + } + fmt.Printf("%s%s\n\n\n", indent, - comment.Message, + message, ) } -- cgit