1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-08-24 07:59:55 +08:00
parent 55757db1d8
commit b196af799c
5 changed files with 20 additions and 2 deletions

View File

@ -223,7 +223,11 @@ func HashInputs(m *ice.Message, arg ...Any) *ice.Message {
}
func HashCreate(m *ice.Message, arg ...Any) string {
msg := m.Spawn()
return m.Echo(msg.Cmdx(INSERT, m.PrefixKey(), "", HASH, HashArgs(msg, arg...))).Result()
args := HashArgs(msg, arg...)
if len(args) == 0 {
args = m.OptionSimple(m.Config(FIELD))
}
return m.Echo(msg.Cmdx(INSERT, m.PrefixKey(), "", HASH, args)).Result()
}
func HashRemove(m *ice.Message, arg ...Any) *ice.Message {
args := kit.Simple(arg)

View File

@ -119,6 +119,8 @@ func _install_start(m *ice.Message, arg ...string) {
switch cb := m.Optionv(PREPARE).(type) {
case func(string) []string:
args = append(args, cb(p)...)
case func(string, int):
cb(p, kit.Int(path.Base(p)))
case func(string):
cb(p)
case nil:

View File

@ -41,6 +41,9 @@ func _field_show(m *ice.Message, name, text string, arg ...string) {
name = cmd.Help
}
})
if len(meta) == 0 {
return
}
if !aaa.Right(m.Spawn(), cmds[0]) {
return
}

View File

@ -21,6 +21,12 @@ const SHELL = "shell"
func init() {
Index.Merge(&ice.Context{Commands: ice.Commands{
SHELL: {Name: "shell [name] cmd", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
if len(arg) == 1 {
m.Cmdy(SPARK, SHELL, arg)
} else {
m.Cmdy(SPARK, arg)
}
return
arg = _name(m, arg)
_shell_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
}},

View File

@ -108,7 +108,7 @@ func init() {
}
ctx.DisplayStory(m, "spide.js", mdb.FIELD, nfs.PATH, "root", arg[0])
if len(arg) == 1 || !strings.HasSuffix(arg[1], arg[2]) { // 目录列表
if len(arg) == 1 { // 目录列表
m.Option(nfs.DIR_DEEP, ice.TRUE)
color := []string{cli.YELLOW, cli.BLUE, cli.CYAN, cli.RED}
nfs.Dir(m, nfs.PATH).Tables(func(value ice.Maps) {
@ -116,6 +116,9 @@ func init() {
})
return
}
if arg[1] != arg[2] {
return
}
// 语法解析
switch m.Option(cli.CMD_DIR, m.Option(nfs.DIR_ROOT)); kit.Ext(arg[1]) {