rename status -> list. add pool cmd stub
This commit is contained in:
parent
42960560f3
commit
5d1d80310e
|
@ -27,16 +27,26 @@ var unregCmd = &warren.Command{
|
|||
Run: warrendRun,
|
||||
}
|
||||
|
||||
var statusUsage = `
|
||||
warren status - Get the status from the warrend server
|
||||
var listUsage = `
|
||||
warren list - Get the status from the warrend server
|
||||
`
|
||||
var statusCmd = &warren.Command{
|
||||
Name: "status",
|
||||
Usage: statusUsage,
|
||||
Summary: "Get the status from the warrend server",
|
||||
var listCmd = &warren.Command{
|
||||
Name: "list",
|
||||
Usage: listUsage,
|
||||
Summary: "Get a list of deployments from the warrend server",
|
||||
Run: warrendRun,
|
||||
}
|
||||
|
||||
var poolUsage = `
|
||||
warren pool - Get/set the pool range for a deployment
|
||||
`
|
||||
var poolCmd = &warren.Command{
|
||||
Name: "pool",
|
||||
Usage: poolUsage,
|
||||
Summary: "warren pool - Get/set the pool range for a deployment",
|
||||
Run: warrendRun,
|
||||
}
|
||||
|
||||
func warrendRun(cmd *warren.Command, args ...string) {
|
||||
|
||||
s, err := net.Dial(warren.CmdSockType, warren.CmdSockAddr)
|
||||
|
|
|
@ -25,9 +25,10 @@ func usage() {
|
|||
func main() {
|
||||
warren.RegisterCommand(buildCmd)
|
||||
warren.RegisterCommand(deployCmd)
|
||||
warren.RegisterCommand(statusCmd)
|
||||
warren.RegisterCommand(listCmd)
|
||||
warren.RegisterCommand(regCmd)
|
||||
warren.RegisterCommand(unregCmd)
|
||||
warren.RegisterCommand(poolCmd)
|
||||
warren.RegisterCommand(versionCmd)
|
||||
args := os.Args[1:]
|
||||
if len(args) == 0 || args[0] == "-h" {
|
||||
|
|
|
@ -6,26 +6,26 @@ import (
|
|||
"net"
|
||||
)
|
||||
|
||||
var statusUsage = `
|
||||
status -
|
||||
var listUsage = `
|
||||
list -
|
||||
`
|
||||
|
||||
var statusCmd = &SockCommand{
|
||||
var listCmd = &SockCommand{
|
||||
Command: warren.Command{
|
||||
Name: "status",
|
||||
Usage: statusUsage,
|
||||
Summary: "Print status of warrend",
|
||||
Name: "list",
|
||||
Usage: listUsage,
|
||||
Summary: "Print list of warren deployments",
|
||||
},
|
||||
Run: statusRun,
|
||||
Run: listRun,
|
||||
}
|
||||
|
||||
func statusRun(cmd *SockCommand, c net.Conn, path string, args ...string) {
|
||||
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, "Status\n")
|
||||
warren.WriteStringz(c, "List\n")
|
||||
|
||||
for n, p := range conf.GetConf().Deployments {
|
||||
warren.WriteStringz(c, n+": "+p+"\n")
|
|
@ -130,7 +130,7 @@ func main() {
|
|||
|
||||
initRunning()
|
||||
|
||||
warren.RegisterCommand(statusCmd)
|
||||
warren.RegisterCommand(listCmd)
|
||||
warren.RegisterCommand(regCmd)
|
||||
warren.RegisterCommand(unregCmd)
|
||||
|
||||
|
|
Loading…
Reference in New Issue