Added title and description for CREATE ISSUE CLI

This commit is contained in:
Moira Daniella A Sebastian
2026-02-04 18:21:06 +01:00
parent b56a0a3f43
commit 7eadda8e33

View File

@@ -1,13 +1,19 @@
package commands
import (
"github.com/LazyBachelor/LazyPM/internal/models"
"fmt"
"os"
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/spf13/cobra"
)
var (
createTitle string
createDescription string
)
var createCmd = &cobra.Command{
Use: "create",
Short: "Create a new issue",
@@ -15,10 +21,16 @@ var createCmd = &cobra.Command{
RunE: runCreateCmd,
}
func init() {
createCmd.Flags().StringVar(&createTitle, "title", "", "Issue title")
_ = createCmd.MarkFlagRequired("title")
createCmd.Flags().StringVar(&createDescription, "desc", "", "Issue description")
}
func runCreateCmd(cmd *cobra.Command, args []string) error {
issue := &models.Issue{
Title: "test",
Description: "This is a test issue created by the CLI.",
Title: createTitle,
Description: createDescription,
Status: models.StatusOpen,
IssueType: models.TypeBug,
Priority: 0,