mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 17:44:05 +08:00
opt golang
This commit is contained in:
parent
f18691ea29
commit
cd3d57a6f7
@ -19,7 +19,7 @@ func _cache_save(m *ice.Message, kind, name, text string, arg ...string) { // fi
|
|||||||
if name == "" {
|
if name == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(text) > 512 { // 存入文件
|
if len(text) > 512 || kind == "go" { // 存入文件
|
||||||
p := m.Cmdx(nfs.SAVE, _cache_name(m, kit.Hashs(text)), text)
|
p := m.Cmdx(nfs.SAVE, _cache_name(m, kit.Hashs(text)), text)
|
||||||
text, arg = p, kit.Simple(p, len(text))
|
text, arg = p, kit.Simple(p, len(text))
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ func init() {
|
|||||||
"string", "byte", "bool", "error", "chan", "map",
|
"string", "byte", "bool", "error", "chan", "map",
|
||||||
),
|
),
|
||||||
FUNCTION, kit.Simple(
|
FUNCTION, kit.Simple(
|
||||||
"len", "cap", "copy", "append", "msg", "m",
|
"new", "make", "len", "cap", "copy", "append", "delete", "msg", "m",
|
||||||
),
|
),
|
||||||
CONSTANT, kit.Simple(
|
CONSTANT, kit.Simple(
|
||||||
"false", "true", "nil", "-1", "0", "1", "2",
|
"false", "true", "nil", "-1", "0", "1", "2",
|
||||||
|
7
misc.go
7
misc.go
@ -316,6 +316,13 @@ func (c *Context) cmd(m *Message, cmd *Command, key string, arg ...string) *Mess
|
|||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
func (c *Context) _cmd(m *Message, cmd *Command, key string, k string, h *Action, arg ...string) *Message {
|
func (c *Context) _cmd(m *Message, cmd *Command, key string, k string, h *Action, arg ...string) *Message {
|
||||||
|
if k == "command" && h.Hand == nil {
|
||||||
|
for _, cmd := range arg {
|
||||||
|
m.Cmdy("command", cmd)
|
||||||
|
}
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
if k == "run" && m.Warn(!m.Right(arg), ErrNotRight, arg) {
|
if k == "run" && m.Warn(!m.Right(arg), ErrNotRight, arg) {
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ func init() {
|
|||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
m.Conf(REPOS, kit.MDB_HASH, "")
|
||||||
_repos_insert(m, path.Base(kit.Pwd()), kit.Pwd())
|
_repos_insert(m, path.Base(kit.Pwd()), kit.Pwd())
|
||||||
m.Cmd(nfs.DIR, kit.SSH_USR, "name,path").Table(func(index int, value map[string]string, head []string) {
|
m.Cmd(nfs.DIR, kit.SSH_USR, "name,path").Table(func(index int, value map[string]string, head []string) {
|
||||||
_repos_insert(m, value[kit.MDB_NAME], value[kit.MDB_PATH])
|
_repos_insert(m, value[kit.MDB_NAME], value[kit.MDB_PATH])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user