forked from x/icebergs
opt some
This commit is contained in:
parent
314655bc5e
commit
9a36e8fcc1
@ -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"))
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ var _main_template = `<!DOCTYPE html>
|
||||
<link href="/page/index.css{{.version}}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<script>_version = "{{.version}}"</script>
|
||||
<script src="/proto.js{{.version}}"></script>
|
||||
<script>Volcanos.meta.version = "{{.version}}"</script>
|
||||
<script src="/page/cache.js{{.version}}"></script>
|
||||
<script>{{.script}}</script>
|
||||
</body>
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user