From 52606629fbb0172fda46ad3e3fe37fc77462eb3a Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Sat, 3 Oct 2020 12:51:20 +0200 Subject: [PATCH] Show help message if no tickets in status --- model/campaign.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/model/campaign.go b/model/campaign.go index 47ad306..75946c4 100644 --- a/model/campaign.go +++ b/model/campaign.go @@ -73,6 +73,11 @@ func (c *Campaign) PrintStatus() { } fmt.Printf("Current campaign for %s with summary\n%s\n\n", color.GreenString(c.Github.Repo), color.CyanString(c.Summary)) + if totalTickets == 0 { + fmt.Println("There are no tickets in the campaign. Run \"campaigner add --help\" to find out how to add them.") + return + } + w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', tabwriter.AlignRight) fmt.Fprintf(w, " %d\t-\ttotal tickets\t\n", totalTickets) fmt.Fprintf(w, " %d\t%d%%\tpublished in Jira\t\n", totalPublishedJira, totalPublishedJira * 100 / totalTickets)