mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
e2b2212724
commit
e20bcc8c85
@ -6,4 +6,4 @@ const CTX = "ctx"
|
||||
|
||||
var Index = &ice.Context{Name: CTX, Help: "标准模块"}
|
||||
|
||||
func init() { ice.Index.Register(Index, nil, CONTEXT, COMMAND, CONFIG, MESSAGE) }
|
||||
func init() { ice.Index.Register(Index, nil, CONTEXT, COMMAND, CONFIG, MESSAGE, OPTION) }
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const MESSAGE = "message"
|
||||
const OPTION = "option"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
@ -22,5 +23,12 @@ func init() {
|
||||
m.Push(mdb.TEXT, strings.Split(p, ice.ICEBERGS+"/")[1])
|
||||
}
|
||||
}},
|
||||
OPTION: {Name: "option", Help: "选项", Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) > 1 {
|
||||
if msg, ok := m.Optionv("message").(*ice.Message); ok {
|
||||
msg.Option(arg[0], arg[1])
|
||||
}
|
||||
}
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ func (f *Frame) scan(m *ice.Message, h, line string) *Frame {
|
||||
f.ps2 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS2)))
|
||||
ps := f.ps1
|
||||
|
||||
m.Optionv("message", m)
|
||||
if m.I, m.O = f.stdin, f.stdout; h == STDIO {
|
||||
gdb.Event(m, SOURCE_STDIO)
|
||||
m.Sleep("3s")
|
||||
|
Loading…
x
Reference in New Issue
Block a user