mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
1e09b9c34c
commit
117b55ef8f
@ -98,7 +98,7 @@ func init() {
|
|||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
COMMAND: {Name: "command [all] command", Help: "命令", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
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...)
|
all, arg := _parse_arg_all(m, arg...)
|
||||||
_command_list(m, all, kit.Select("", arg, 0))
|
_command_list(m, all, strings.Join(arg, "."))
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package ssh
|
package ssh
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
"github.com/shylinux/icebergs/base/aaa"
|
"github.com/shylinux/icebergs/base/aaa"
|
||||||
"github.com/shylinux/icebergs/base/cli"
|
"github.com/shylinux/icebergs/base/cli"
|
||||||
"github.com/shylinux/icebergs/base/mdb"
|
"github.com/shylinux/icebergs/base/mdb"
|
||||||
"github.com/shylinux/icebergs/base/web"
|
"github.com/shylinux/icebergs/base/web"
|
||||||
"github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
|
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"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) {
|
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:]...)
|
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) {
|
TARGET: {Name: "target name", Help: "当前模块", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
@ -286,7 +286,7 @@ func init() {
|
|||||||
STACK: {Name: "stack", Help: "结构", Value: kit.Data("template", stack)},
|
STACK: {Name: "stack", Help: "结构", Value: kit.Data("template", stack)},
|
||||||
|
|
||||||
WORD: {Name: "word", Help: "语言文字", Value: kit.Data(kit.MDB_SHORT, "name",
|
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},
|
LABEL: []interface{}{CHART, LABEL},
|
||||||
CHAIN: []interface{}{CHART, CHAIN},
|
CHAIN: []interface{}{CHART, CHAIN},
|
||||||
|
|
||||||
|
7
meta.go
7
meta.go
@ -388,7 +388,12 @@ func (m *Message) Split(str string, field string, space string, enter string) *M
|
|||||||
continue
|
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)
|
m.Push(kit.Select("some", fields, i), v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user