package servicegen import ( "github.com/spf13/cobra" "log" ) func Command() *cobra.Command { newCmd := &cobra.Command{ Use: "new [string to new]", Short: "create service for hasaki", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { err := Gen(args[0]) if err != nil { log.Printf("Error: %+v\n", err) } }, } serviceCmd := &cobra.Command{ Use: "service", Short: "service command"} serviceCmd.AddCommand(newCmd) return serviceCmd }