2025-09-26 09:33:16 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"code.oliverdavies.uk/opdavies/cmd-zet/internal/lib"
|
|
|
|
)
|
|
|
|
|
|
|
|
var createCmd = &cobra.Command{
|
|
|
|
Use: "create",
|
2025-09-26 12:24:08 +01:00
|
|
|
Aliases: []string{"c", "n", "new"},
|
2025-09-26 09:33:16 +01:00
|
|
|
Short: "A brief description of your command",
|
|
|
|
Long: `A longer description that spans multiple lines and likely contains examples
|
|
|
|
and usage of using your command. For example:
|
|
|
|
|
|
|
|
Cobra is a CLI library for Go that empowers applications.
|
|
|
|
This application is a tool to generate the needed files
|
|
|
|
to quickly create a Cobra application.`,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
title := ""
|
2025-09-26 12:17:37 +01:00
|
|
|
|
2025-09-26 09:33:16 +01:00
|
|
|
if len(args) > 0 {
|
|
|
|
title = strings.Join(args, " ")
|
|
|
|
}
|
|
|
|
|
|
|
|
lib.CreateZet(title)
|
|
|
|
},
|
|
|
|
}
|