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