+ Adds new commands for managing boxes, environment variables, and running the server. * The command structure is greatly expanded to improve user experience and coverage for core service functionalities.
22 lines
418 B
Go
22 lines
418 B
Go
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
|
|
}
|