2015-05-01 20:59:46 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"github.com/khlieng/name_pending/server"
|
|
|
|
"github.com/khlieng/name_pending/storage"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
rootCmd = &cobra.Command{
|
2015-05-01 23:02:21 +00:00
|
|
|
Use: "name_pending",
|
|
|
|
Short: "Web-based IRC client in Go.",
|
2015-05-01 20:59:46 +00:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2015-05-01 23:02:21 +00:00
|
|
|
storage.Initialize()
|
|
|
|
server.Run(port)
|
2015-05-01 20:59:46 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2015-05-01 23:02:21 +00:00
|
|
|
port int
|
2015-05-01 20:59:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2015-05-01 23:02:21 +00:00
|
|
|
rootCmd.AddCommand(clearCmd)
|
|
|
|
|
2015-05-01 20:59:46 +00:00
|
|
|
rootCmd.Flags().IntVarP(&port, "port", "p", 1337, "port to listen on")
|
|
|
|
}
|
|
|
|
|
|
|
|
func Execute() {
|
|
|
|
rootCmd.Execute()
|
|
|
|
}
|