From f153effe97510f914b288e60290a7f9723949322 Mon Sep 17 00:00:00 2001 From: shaoying Date: Wed, 4 Dec 2019 23:35:23 +0800 Subject: [PATCH] add prune all --- src/examples/code/code.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/examples/code/code.go b/src/examples/code/code.go index b914dad0..1ee1a288 100644 --- a/src/examples/code/code.go +++ b/src/examples/code/code.go @@ -440,11 +440,11 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心", } return }}, - "prune": {Name: "prune type sid...", Help: "清理", Hand: func(m *ctx.Message, c *ctx.Context, cmd string, arg ...string) (e error) { + "prune": {Name: "prune type all|sid...", Help: "清理", Hand: func(m *ctx.Message, c *ctx.Context, cmd string, arg ...string) (e error) { ps := arg[1:] - if len(ps) == 0 { + if len(ps) == 0 || ps[0] == "all" { m.Confm("login", "hash", func(key string, value map[string]interface{}) { - if value["type"] == arg[0] && kit.Format(value["status"]) == "logout" { + if value["type"] == arg[0] && (kit.Format(value["status"]) == "logout" || len(ps) > 0) { ps = append(ps, key) } })