From 425590cc9a8ee16c24c07b9ecc5327f9cfe5673b Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Sat, 29 Feb 2020 21:56:43 +0100 Subject: [PATCH] Add standalone create-jira command structure --- README.md | 1 + cmd/standalone.go | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 cmd/standalone.go diff --git a/README.md b/README.md index 83d182a..5538d46 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Use "campaigner [command] --help" for more information about a command. `--grep` and `--govet` flags to distinguish how to parse the input. - [ ] Add `standalone` group of commands. +- [ ] Parametrise the atlassian API url. - [ ] Add file only mode to the `add` command. - [ ] Add file path normalisation to the `add` command. - [ ] Add `--ag` to the `add` command. diff --git a/cmd/standalone.go b/cmd/standalone.go new file mode 100644 index 0000000..6582eb8 --- /dev/null +++ b/cmd/standalone.go @@ -0,0 +1,39 @@ +package cmd + +func StandaloneCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "standalone", + Short: "Standalone fire-and-forget commands", + } + + cmd.AddCommand( + CreateJiraTicketStandaloneCmd(), + ) + + return cmd +} + +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", "", "the variables to use in the template") + + return cmd +} + +func createJiraTicketStandaloneCmdF(cmd *cobra.Command, _ []string) { + +} \ No newline at end of file