35 lines
606 B
Go
35 lines
606 B
Go
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")
|
|
|
|
for n, p := range conf.GetConf().Deployments {
|
|
warren.WriteStringz(c, n+": "+p+"\n")
|
|
}
|
|
|
|
}
|