2020-03-04 22:22:16 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func JiraPublishCmd() *cobra.Command {
|
2020-03-05 20:42:25 +01:00
|
|
|
cmd := &cobra.Command{
|
2020-03-04 22:22:16 +01:00
|
|
|
Use: "jira",
|
|
|
|
Short: "Publishes the campaign tickets in JIRA",
|
|
|
|
Args: cobra.NoArgs,
|
2020-03-05 20:42:25 +01:00
|
|
|
RunE: jiraPublishCmdF,
|
2020-03-04 22:22:16 +01:00
|
|
|
}
|
2020-03-05 20:42:25 +01:00
|
|
|
|
|
|
|
cmd.Flags().BoolP("all", "a", false, "Publish all the tickets of the campaign")
|
|
|
|
cmd.Flags().IntP("batch", "b", 0, "Number of tickets to publish")
|
|
|
|
|
|
|
|
return cmd
|
2020-03-04 22:22:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func PublishCmd() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "publish",
|
|
|
|
Short: "Publishes the campaign tickets in different providers",
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd.AddCommand(
|
|
|
|
JiraPublishCmd(),
|
|
|
|
)
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
}
|
|
|
|
|
2020-03-05 20:42:25 +01:00
|
|
|
func jiraPublishCmdF(cmd *cobra.Command, _ []string) error {
|
|
|
|
/*
|
|
|
|
all, _ := cmd.Flags().GetBool("all")
|
|
|
|
batch, _ := cmd.Flags().GetInt("batch")
|
|
|
|
|
|
|
|
if !all && batch == 0 {
|
|
|
|
return fmt.Errorf("One of --all or --batch flags is required")
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|