mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +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) {
|
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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user