Adds published-only flag to the list command

This commit is contained in:
Miguel de la Cruz 2020-10-07 20:06:29 +02:00
parent ce96e712e4
commit 8494b273dd
2 changed files with 10 additions and 4 deletions

View file

@ -88,7 +88,7 @@ func (c *Campaign) PrintStatus() {
w.Flush()
}
func (c *Campaign) PrintList() {
func (c *Campaign) PrintList(publishedOnly bool) {
for _, t := range c.Tickets {
if t.IsPublishedJira() {
var str string
@ -101,7 +101,7 @@ func (c *Campaign) PrintList() {
str += fmt.Sprintf(" (%s)", color.MagentaString(t.GithubStatus))
}
fmt.Println(str)
} else {
} else if !publishedOnly {
b, _ := json.Marshal(t)
fmt.Printf("unpublished: %s\n", color.YellowString(string(b)))
}