Show help message if no tickets in status

This commit is contained in:
Miguel de la Cruz 2020-10-03 12:51:20 +02:00
parent 164f33949b
commit 52606629fb

View file

@ -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)) 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) 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-\ttotal tickets\t\n", totalTickets)
fmt.Fprintf(w, " %d\t%d%%\tpublished in Jira\t\n", totalPublishedJira, totalPublishedJira * 100 / totalTickets) fmt.Fprintf(w, " %d\t%d%%\tpublished in Jira\t\n", totalPublishedJira, totalPublishedJira * 100 / totalTickets)