gotest/cmd/run.go
2019-09-07 09:48:31 -05:00

21 lines
408 B
Go

package cmd
import (
"git.bloy.org/mike/gotest/web"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(runCmd)
runCmd.Flags().String("addr", ":8000", "Port to serve http")
}
var runCmd = &cobra.Command{
Use: "run",
Short: "Run the webserver",
Long: "Listen to the specified port and serve http until interrupted",
Run: func(cmd *cobra.Command, args []string) {
web.RunServer()
},
}