mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-27 12:05:23 +00:00
Rename help to list
This commit is contained in:
parent
a6be4bacbc
commit
315aadae06
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user