mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 18:37:29 +08:00
opt some
This commit is contained in:
parent
55757db1d8
commit
b196af799c
@ -223,7 +223,11 @@ func HashInputs(m *ice.Message, arg ...Any) *ice.Message {
|
|||||||
}
|
}
|
||||||
func HashCreate(m *ice.Message, arg ...Any) string {
|
func HashCreate(m *ice.Message, arg ...Any) string {
|
||||||
msg := m.Spawn()
|
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 {
|
func HashRemove(m *ice.Message, arg ...Any) *ice.Message {
|
||||||
args := kit.Simple(arg)
|
args := kit.Simple(arg)
|
||||||
|
@ -119,6 +119,8 @@ func _install_start(m *ice.Message, arg ...string) {
|
|||||||
switch cb := m.Optionv(PREPARE).(type) {
|
switch cb := m.Optionv(PREPARE).(type) {
|
||||||
case func(string) []string:
|
case func(string) []string:
|
||||||
args = append(args, cb(p)...)
|
args = append(args, cb(p)...)
|
||||||
|
case func(string, int):
|
||||||
|
cb(p, kit.Int(path.Base(p)))
|
||||||
case func(string):
|
case func(string):
|
||||||
cb(p)
|
cb(p)
|
||||||
case nil:
|
case nil:
|
||||||
|
@ -41,6 +41,9 @@ func _field_show(m *ice.Message, name, text string, arg ...string) {
|
|||||||
name = cmd.Help
|
name = cmd.Help
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if len(meta) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
if !aaa.Right(m.Spawn(), cmds[0]) {
|
if !aaa.Right(m.Spawn(), cmds[0]) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,12 @@ const SHELL = "shell"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{Commands: ice.Commands{
|
Index.Merge(&ice.Context{Commands: ice.Commands{
|
||||||
SHELL: {Name: "shell [name] cmd", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
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)
|
arg = _name(m, arg)
|
||||||
_shell_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
|
_shell_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
|
||||||
}},
|
}},
|
||||||
|
@ -108,7 +108,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
ctx.DisplayStory(m, "spide.js", mdb.FIELD, nfs.PATH, "root", arg[0])
|
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)
|
m.Option(nfs.DIR_DEEP, ice.TRUE)
|
||||||
color := []string{cli.YELLOW, cli.BLUE, cli.CYAN, cli.RED}
|
color := []string{cli.YELLOW, cli.BLUE, cli.CYAN, cli.RED}
|
||||||
nfs.Dir(m, nfs.PATH).Tables(func(value ice.Maps) {
|
nfs.Dir(m, nfs.PATH).Tables(func(value ice.Maps) {
|
||||||
@ -116,6 +116,9 @@ func init() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if arg[1] != arg[2] {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 语法解析
|
// 语法解析
|
||||||
switch m.Option(cli.CMD_DIR, m.Option(nfs.DIR_ROOT)); kit.Ext(arg[1]) {
|
switch m.Option(cli.CMD_DIR, m.Option(nfs.DIR_ROOT)); kit.Ext(arg[1]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user