diff --git a/base/ctx/cmd.go b/base/ctx/cmd.go index d7353c9b..e3de18fb 100644 --- a/base/ctx/cmd.go +++ b/base/ctx/cmd.go @@ -98,7 +98,7 @@ func init() { Commands: map[string]*ice.Command{ COMMAND: {Name: "command [all] command", Help: "命令", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { all, arg := _parse_arg_all(m, arg...) - _command_list(m, all, kit.Select("", arg, 0)) + _command_list(m, all, strings.Join(arg, ".")) }}, }, }, nil) diff --git a/base/ssh/ssh.go b/base/ssh/ssh.go index 8a8d4191..e3c39be9 100644 --- a/base/ssh/ssh.go +++ b/base/ssh/ssh.go @@ -1,12 +1,12 @@ package ssh import ( - "github.com/shylinux/icebergs" + ice "github.com/shylinux/icebergs" "github.com/shylinux/icebergs/base/aaa" "github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/web" - "github.com/shylinux/toolkits" + kit "github.com/shylinux/toolkits" "bufio" "bytes" @@ -332,6 +332,10 @@ var Index = &ice.Context{Name: "ssh", Help: "终端模块", }}, SOURCE: {Name: "source file", Help: "脚本解析", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if _, e := os.Stat(arg[0]); e != nil { + arg[0] = path.Join(path.Dir(m.Option("_script")), arg[0]) + } + m.Option("_script", arg[0]) m.Starts(strings.Replace(arg[0], ".", "_", -1), arg[0], arg[0:]...) }}, TARGET: {Name: "target name", Help: "当前模块", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { diff --git a/core/wiki/word.go b/core/wiki/word.go index 8201c79f..aabd3eca 100644 --- a/core/wiki/word.go +++ b/core/wiki/word.go @@ -286,7 +286,7 @@ func init() { STACK: {Name: "stack", Help: "结构", Value: kit.Data("template", stack)}, WORD: {Name: "word", Help: "语言文字", Value: kit.Data(kit.MDB_SHORT, "name", - "path", "usr/demo", "regs", ".*\\.shy", "alias", map[string]interface{}{ + "path", "usr", "regs", ".*\\.shy", "alias", map[string]interface{}{ LABEL: []interface{}{CHART, LABEL}, CHAIN: []interface{}{CHART, CHAIN}, diff --git a/meta.go b/meta.go index b1134fd0..12800ea1 100644 --- a/meta.go +++ b/meta.go @@ -388,7 +388,12 @@ func (m *Message) Split(str string, field string, space string, enter string) *M continue } - for i, v := range kit.Split(l, space, space) { + ls := kit.Split(l, space, space) + for i, v := range ls { + if i == len(fields)-1 { + m.Push(kit.Select("some", fields, i), strings.Join(ls[i:], space)) + break + } m.Push(kit.Select("some", fields, i), v) } }