diff --git a/cmd/init.go b/cmd/init.go index ef6776e..07d80a5 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -17,13 +17,16 @@ func InitCmd() *cobra.Command { cmd.Flags().StringP("epic", "e", "", "the epic id to associate this campaign with") _ = cmd.MarkFlagRequired("epic") + cmd.Flags().StringP("summary", "s", "", "the summary of the tickets. Can contain the variables {{.Filename}}, {{.LineNo}} and {{.Text}}") + _ = cmd.MarkFlagRequired("summary") return cmd } func initCmdF(cmd *cobra.Command, _ []string) { epic, _ := cmd.Flags().GetString("epic") - if err := campaign.Save(&model.Campaign{Epic: epic}); err != nil { + summary, _ := cmd.Flags().GetString("summary") + if err := campaign.Save(&model.Campaign{Epic: epic, Summary: summary}); err != nil { ErrorAndExit(cmd, err) } } diff --git a/model/campaign.go b/model/campaign.go index b0c2267..27534ab 100644 --- a/model/campaign.go +++ b/model/campaign.go @@ -2,5 +2,6 @@ package model type Campaign struct { Epic string `json:"epic"` + Summary string `json:"summary"` Tickets []*Ticket `json:"tickets,omitempty"` }