diff --git a/cmd/root.go b/cmd/root.go index 3b9f2b9..5d52207 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,6 +17,7 @@ func RootCmd() *cobra.Command { AddCmd(), FilterCmd(), InitCmd(), + StandaloneCmd(), TokenCmd(), ) diff --git a/cmd/standalone.go b/cmd/standalone.go index 6582eb8..1a5b3ce 100644 --- a/cmd/standalone.go +++ b/cmd/standalone.go @@ -1,39 +1,43 @@ package cmd +import ( + "github.com/spf13/cobra" +) + func StandaloneCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "standalone", - Short: "Standalone fire-and-forget commands", - } - - cmd.AddCommand( - CreateJiraTicketStandaloneCmd(), - ) - - return cmd + 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 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) { - -} \ No newline at end of file + +}