package main

import (
	"warpbox/lib/server"

	"github.com/spf13/cobra"
)

func newRunCommand() *cobra.Command {
	var addr string
	cmd := &cobra.Command{
		Use:   "run",
		Short: "Run the HTTP server",
		Long:  "Run the WarpBox HTTP server.",
		RunE: func(cmd *cobra.Command, args []string) error {
			return server.Run(addr)
		},
	}
	cmd.Flags().StringVar(&addr, "addr", ":8080", "HTTP server address")
	return cmd
}
