warren/cmd/warrend/cmd_status.go

35 lines
609 B
Go
Raw Normal View History

package main
import (
"github.com/dballard/warren/cmd/warrend/conf"
"github.com/dballard/warren/lib/warren"
"net"
)
var statusUsage = `
status -
`
var statusCmd = &SockCommand{
Command: warren.Command{
Name: "status",
2015-02-14 19:42:02 +00:00
Usage: statusUsage,
Summary: "Print status of warrend",
},
Run: statusRun,
}
func statusRun(cmd *SockCommand, c net.Conn, path string, args ...string) {
if len(args) > 0 && args[0] == "help" {
warren.WriteStringz(c, cmd.Usage)
return
}
2015-02-14 19:42:02 +00:00
warren.WriteStringz(c, "Status\n")
for n, p := range conf.GetConf().Deployments {
warren.WriteStringz(c, n+": "+p)
2015-02-14 19:42:02 +00:00
}
}