diff --git a/base/nfs/grep.go b/base/nfs/grep.go index 5e8fc242..bb166822 100644 --- a/base/nfs/grep.go +++ b/base/nfs/grep.go @@ -5,6 +5,7 @@ import ( ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/mdb" + kit "shylinux.com/x/toolkits" ) const GREP = "grep" @@ -12,12 +13,13 @@ const GREP = "grep" func init() { Index.MergeCommands(ice.Commands{ GREP: {Name: "grep word path auto", Help: "搜索", Hand: func(m *ice.Message, arg ...string) { - m.Option("cmd_dir", arg[1]) + m.Option("cmd_dir", kit.Select(m.Option(PATH), arg, 1)) for _, line := range strings.Split(m.Cmdx("cli.system", GREP, "--exclude=.[a-z]*", "--exclude-dir=.[a-z]*", "-rni", arg[0], ice.PT), ice.NL) { if ls := strings.SplitN(line, ice.DF, 3); len(ls) > 2 { - m.Push(FILE, ls[0]).Push(LINE, ls[1]).Push(mdb.TEXT, ls[2]) + m.Push(FILE, strings.TrimPrefix(ls[0], PWD)).Push(LINE, ls[1]).Push(mdb.TEXT, ls[2]) } } + m.StatusTimeCount(PATH, m.Option("cmd_dir")) }}, }) } diff --git a/base/web/render.go b/base/web/render.go index 57b3f26e..fe04da9d 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -194,8 +194,8 @@ var _main_template = ` + - diff --git a/core/code/inner.go b/core/code/inner.go index 1938e0c1..957f135c 100644 --- a/core/code/inner.go +++ b/core/code/inner.go @@ -102,7 +102,7 @@ func init() { mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { _inner_show(m, arg[0], arg[1], arg[2]) }}, mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _inner_exec(m, arg[0], arg[1], arg[2]) }}, nfs.GREP: {Help: "搜索", Hand: func(m *ice.Message, arg ...string) { - m.Cmdy(nfs.GREP, arg[0], m.Option(nfs.PATH)).StatusTimeCount(mdb.INDEX, 0) + m.Cmdy(nfs.GREP, arg[0], kit.Select(m.Option(nfs.PATH), arg, 1)) }}, nfs.TAGS: {Help: "索引", Hand: func(m *ice.Message, arg ...string) { if _inner_tags(m, m.Option(nfs.PATH), arg[0]); m.Length() == 0 { diff --git a/core/code/vimer.go b/core/code/vimer.go index e7e1f858..cb2af1b7 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -16,7 +16,7 @@ import ( ) func _vimer_make(m *ice.Message, dir string, msg *ice.Message) { - defer m.StatusTime() + defer m.StatusTimeCount() for _, line := range strings.Split(msg.Append(cli.CMD_ERR), ice.NL) { if !strings.Contains(line, ice.DF) { continue