warren/cmd/warrend/cmd_list.go

35 lines
606 B
Go
Raw Normal View History

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