1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

opt route

This commit is contained in:
shaoying 2021-01-16 05:21:31 +08:00
parent 188bdbc6e3
commit 9b11b4aa20
4 changed files with 10 additions and 3 deletions

View File

@ -115,6 +115,7 @@ func init() {
m.Option(ice.MSG_PROCESS, ice.PROCESS_INNER)
}},
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
m.Debug(m.Option(ROUTE))
m.Cmdy(SPACE, m.Option(ROUTE), kit.Keys(m.Option(kit.SSH_CTX), m.Option(kit.SSH_CMD)), arg)
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
@ -124,7 +125,7 @@ func init() {
}
} else if len(arg) > 2 { // 加载插件
m.ShowPlugin(arg[0], arg[1], arg[2], ctx.COMMAND)
m.ShowPlugin(arg[0], arg[1], arg[2], kit.MDB_ACTION, ctx.COMMAND)
} else if len(arg) > 1 { // 命令列表
m.Cmd(SPACE, arg[0], ctx.CONTEXT, arg[1], ctx.COMMAND).Table(func(index int, value map[string]string, head []string) {

View File

@ -91,6 +91,10 @@ func init() {
FAVOR: {Name: "favor insert", Help: "收藏"},
mdb.INPUTS: {Name: "favor inputs", Help: "补全"},
nfs.DIR: {Name: "dir", Help: "目录"},
"project": {Name: "project", Help: "项目", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0))
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) < 2 {
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0))

View File

@ -15,7 +15,7 @@ const PLAN = "plan"
func init() {
Index.Merge(&ice.Context{
Commands: map[string]*ice.Command{
PLAN: {Name: "plan scale=day,week,month,year,long begin_time@date auto insert export import", Help: "计划", Meta: kit.Dict(
PLAN: {Name: "plan scale=day,week,month,year,long begin_time@date where@province auto insert export import", Help: "计划", Meta: kit.Dict(
"display", "/plugin/local/team/plan.js", "style", "plan",
), Action: map[string]*ice.Action{
mdb.INSERT: {Name: "insert zone type=once,step,week name text begin_time@date close_time@date", Help: "添加", Hand: func(m *ice.Message, arg ...string) {

View File

@ -79,7 +79,9 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典",
_alpha_load(m, m.Option(kit.MDB_FILE), kit.Select(path.Base(m.Option(kit.MDB_FILE)), m.Option(kit.MDB_NAME)))
}},
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
_alpha_find(m, kit.Select("word", arg, 2), arg[1])
if arg[0] == ALPHA {
_alpha_find(m, kit.Select("word", arg, 2), arg[1])
}
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
m.Option(mdb.FIELDS, "id,word,translation,definition")