campaigner/cmd/standalone.go

44 lines
1.1 KiB
Go
Raw Normal View History

package cmd
2020-03-01 01:17:41 +01:00
import (
"github.com/spf13/cobra"
)
func StandaloneCmd() *cobra.Command {
2020-03-01 01:17:41 +01:00
cmd := &cobra.Command{
Use: "standalone",
Short: "Standalone fire-and-forget commands",
}
cmd.AddCommand(
CreateJiraTicketStandaloneCmd(),
)
return cmd
}
2020-03-01 01:17:41 +01:00
func CreateJiraTicketStandaloneCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create-jira-ticket",
Short: "Creates a jira ticket from a template",
Args: cobra.NoArgs,
Run: createJiraTicketStandaloneCmdF,
}
cmd.Flags().StringP("username", "u", "", "the jira username")
_ = cmd.MarkFlagRequired("username")
cmd.Flags().StringP("token", "t", "", "the jira token")
_ = cmd.MarkFlagRequired("token")
cmd.Flags().StringP("summary", "s", "", "the summary of the ticket")
_ = cmd.MarkFlagRequired("summary")
cmd.Flags().StringP("template", "m", "", "the template to render the description of the ticket")
_ = cmd.MarkFlagRequired("template")
cmd.Flags().StringSliceP("vars", "v", []string{}, "the variables to use in the template")
return cmd
}
func createJiraTicketStandaloneCmdF(cmd *cobra.Command, _ []string) {
2020-03-01 01:17:41 +01:00
}