5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-14 16:10:29 +00:00

Rename help to list

This commit is contained in:
Neil Alexander 2018-11-26 17:51:30 +00:00
parent a6be4bacbc
commit 315aadae06
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944
2 changed files with 3 additions and 3 deletions

View File

@ -52,12 +52,12 @@ func (a *admin) addHandler(name string, args []string, handler func(admin_info)
func (a *admin) init(c *Core, listenaddr string) { func (a *admin) init(c *Core, listenaddr string) {
a.core = c a.core = c
a.listenaddr = listenaddr a.listenaddr = listenaddr
a.addHandler("help", nil, func(in admin_info) (admin_info, error) { a.addHandler("list", nil, func(in admin_info) (admin_info, error) {
handlers := make(map[string]interface{}) handlers := make(map[string]interface{})
for _, handler := range a.handlers { for _, handler := range a.handlers {
handlers[handler.name] = admin_info{"fields": handler.args} handlers[handler.name] = admin_info{"fields": handler.args}
} }
return admin_info{"help": handlers}, nil return admin_info{"list": handlers}, nil
}) })
a.addHandler("dot", []string{}, func(in admin_info) (admin_info, error) { a.addHandler("dot", []string{}, func(in admin_info) (admin_info, error) {
return admin_info{"dot": string(a.getResponse_dot())}, nil return admin_info{"dot": string(a.getResponse_dot())}, nil

View File

@ -107,7 +107,7 @@ func main() {
switch strings.ToLower(req["request"].(string)) { switch strings.ToLower(req["request"].(string)) {
case "dot": case "dot":
fmt.Println(res["dot"]) fmt.Println(res["dot"])
case "help", "getpeers", "getswitchpeers", "getdht", "getsessions", "dhtping": case "list", "getpeers", "getswitchpeers", "getdht", "getsessions", "dhtping":
maxWidths := make(map[string]int) maxWidths := make(map[string]int)
var keyOrder []string var keyOrder []string
keysOrdered := false keysOrdered := false