mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt inner
This commit is contained in:
parent
15b0a20563
commit
beb3482c66
@ -27,7 +27,7 @@ func _go_tags(m *ice.Message, key string) {
|
||||
ls := strings.Split(key, ".")
|
||||
key = ls[len(ls)-1]
|
||||
|
||||
if _, e := os.Stat(path.Join(m.Option("_path"), ".tags")); e != nil {
|
||||
if _, e := os.Stat(path.Join(m.Option(cli.CMD_DIR), ".tags")); e != nil {
|
||||
m.Cmd(cli.SYSTEM, "gotags", "-R", "-f", ".tags", "./")
|
||||
}
|
||||
for _, l := range strings.Split(m.Cmdx(cli.SYSTEM, "grep", "^"+key+"\\>", ".tags"), "\n") {
|
||||
@ -42,7 +42,7 @@ func _go_tags(m *ice.Message, key string) {
|
||||
text := strings.TrimSuffix(strings.TrimPrefix(ls[0], "/^"), "$/")
|
||||
line := kit.Int(text)
|
||||
|
||||
p := path.Join(m.Option("_path"), file)
|
||||
p := path.Join(m.Option(cli.CMD_DIR), file)
|
||||
f, e := os.Open(p)
|
||||
m.Assert(e)
|
||||
bio := bufio.NewScanner(f)
|
||||
@ -130,7 +130,7 @@ func init() {
|
||||
if arg[0] == kit.MDB_FOREACH {
|
||||
return
|
||||
}
|
||||
m.Option(cli.CMD_DIR, m.Option("_path"))
|
||||
m.Option(cli.CMD_DIR, kit.Select("src", arg, 2))
|
||||
_go_find(m, kit.Select("main", arg, 1))
|
||||
_go_tags(m, kit.Select("main", arg, 1))
|
||||
_go_help(m, kit.Select("main", arg, 1))
|
||||
|
@ -80,6 +80,9 @@ func init() {
|
||||
FAVOR: {Name: "favor", Help: "收藏", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(FAVOR, mdb.INSERT, arg)
|
||||
}},
|
||||
nfs.DIR: {Name: "dir", Help: "目录", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(nfs.DIR, arg)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if len(arg) < 2 {
|
||||
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0))
|
||||
|
@ -28,9 +28,9 @@ func init() {
|
||||
Index.Merge(&ice.Context{
|
||||
Configs: map[string]*ice.Config{},
|
||||
Commands: map[string]*ice.Command{
|
||||
VIMER: {Name: "vimer path=usr/demo file=hi.sh line=1 刷新:button=auto save project", Help: "编辑器", Meta: kit.Dict(
|
||||
VIMER: {Name: "vimer path=usr/demo file=hi.sh line=1 刷新:button=auto save project search", Help: "编辑器", Meta: kit.Dict(
|
||||
"display", "/plugin/local/code/vimer.js", "style", "editor",
|
||||
"trans", kit.Dict("project", "项目"),
|
||||
"trans", kit.Dict("project", "项目", "search", "搜索"),
|
||||
), Action: map[string]*ice.Action{
|
||||
web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
|
||||
_vimer_upload(m, m.Option(kit.MDB_PATH))
|
||||
|
Loading…
x
Reference in New Issue
Block a user