From 77fc48e3ba733e9de5103b70b7cf5d25839f4fe3 Mon Sep 17 00:00:00 2001 From: shaoying Date: Thu, 17 Sep 2020 10:26:44 +0800 Subject: [PATCH] opt some --- base/ctx/ctx.go | 2 +- base/web/route.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/base/ctx/ctx.go b/base/ctx/ctx.go index 0362fefd..d582a41c 100644 --- a/base/ctx/ctx.go +++ b/base/ctx/ctx.go @@ -43,7 +43,7 @@ var Index = &ice.Context{Name: "ctx", Help: "配置模块", if len(arg) > 1 && arg[1] == COMMAND { m.Search(arg[0]+".", func(sup *ice.Context, sub *ice.Context, key string) { - m.Copy(m.Spawn(sub).Cmd(COMMAND)) + m.Copy(m.Spawn(sub).Cmd(COMMAND, arg[2:])) }) } else { m.Search(arg[0]+".", func(p *ice.Context, s *ice.Context, key string) { diff --git a/base/web/route.go b/base/web/route.go index 60785d90..8adde73b 100644 --- a/base/web/route.go +++ b/base/web/route.go @@ -6,8 +6,6 @@ import ( "github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/nfs" kit "github.com/shylinux/toolkits" - - "strings" ) func _route_travel(m *ice.Message, route string) { @@ -79,8 +77,15 @@ func init() { m.Sleep("3s") }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if len(arg) > 3 && arg[3] == "run" { + m.Cmdy(SPACE, arg[0], kit.Keys(arg[1], arg[2]), arg[4:]) + return + } if len(arg) > 2 && arg[0] != "" { - m.Cmdy(SPACE, arg[0], kit.Split(kit.Keys(arg[1], strings.Join(arg[2:], " ")))) + // m.Cmdy(SPACE, arg[0], kit.Split(kit.Keys(arg[1], strings.Join(arg[2:], " ")))) + m.Cmdy(SPACE, arg[0], "context", arg[1], "command", arg[2]) + m.Option("_process", "_field") + m.Option("_prefix", arg[0], arg[1], arg[2], "run") return } if len(arg) > 1 && arg[0] != "" {