2015-01-02 17:07:30 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"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,
|
2015-01-02 17:07:30 +00:00
|
|
|
Summary: "Print status of warrend",
|
|
|
|
Help: statusUsage,
|
|
|
|
},
|
|
|
|
Run: statusRun,
|
|
|
|
}
|
|
|
|
|
|
|
|
func statusRun(cmd *SockCommand, c net.Conn, args ...string) {
|
2015-01-28 06:20:39 +00:00
|
|
|
if len(args) > 0 && args[0] == "help" {
|
|
|
|
warren.WriteStringz(c, cmd.Help)
|
2015-01-02 17:07:30 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2015-02-14 19:42:02 +00:00
|
|
|
warren.WriteStringz(c, "Status\n")
|
|
|
|
|
|
|
|
for _, d := range deployments {
|
|
|
|
warren.WriteStringz(c, d.Name+": "+d.Path)
|
|
|
|
}
|
|
|
|
|
2015-01-02 17:07:30 +00:00
|
|
|
}
|