feat: add list server command (#2314)
This commit is contained in:
1 parent
f0f7cfbbed
commit
59a27bbaed
5 files changed
+36
-6
No files matched your search
@@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -106,6 +107,15 @@ Loop:
|
||||
} else {
|
||||
echoerr(c, "listen: drop: requires a client id")
|
||||
}
|
||||
case "list":
|
||||
ids := make([]int, 0, len(gConnList))
|
||||
for id := range gConnList {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
sort.Ints(ids)
|
||||
for _, id := range ids {
|
||||
fmt.Fprintln(c, id)
|
||||
}
|
||||
case "send":
|
||||
if rest != "" {
|
||||
word2, rest2 := splitWord(rest)
|
||||
|
||||
Reference in new issue
Block a user