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