1
0
forked from x/icebergs
This commit is contained in:
shaoying 2020-09-17 10:26:44 +08:00
parent b9aa5baf1c
commit 77fc48e3ba
2 changed files with 9 additions and 4 deletions

View File

@ -43,7 +43,7 @@ var Index = &ice.Context{Name: "ctx", Help: "配置模块",
if len(arg) > 1 && arg[1] == COMMAND { if len(arg) > 1 && arg[1] == COMMAND {
m.Search(arg[0]+".", func(sup *ice.Context, sub *ice.Context, key string) { 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 { } else {
m.Search(arg[0]+".", func(p *ice.Context, s *ice.Context, key string) { m.Search(arg[0]+".", func(p *ice.Context, s *ice.Context, key string) {

View File

@ -6,8 +6,6 @@ import (
"github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/cli"
"github.com/shylinux/icebergs/base/nfs" "github.com/shylinux/icebergs/base/nfs"
kit "github.com/shylinux/toolkits" kit "github.com/shylinux/toolkits"
"strings"
) )
func _route_travel(m *ice.Message, route string) { func _route_travel(m *ice.Message, route string) {
@ -79,8 +77,15 @@ func init() {
m.Sleep("3s") m.Sleep("3s")
}}, }},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { }, 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] != "" { 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 return
} }
if len(arg) > 1 && arg[0] != "" { if len(arg) > 1 && arg[0] != "" {