5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-23 08:45:39 +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) {
a.core = c
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{})
for _, handler := range a.handlers {
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) {
return admin_info{"dot": string(a.getResponse_dot())}, nil

View File

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