diff --git a/base/cli/qrcode.go b/base/cli/qrcode.go index c040a10a..2579d7b5 100644 --- a/base/cli/qrcode.go +++ b/base/cli/qrcode.go @@ -10,6 +10,7 @@ import ( "shylinux.com/x/go-qrcode" ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/mdb" kit "shylinux.com/x/toolkits" ) @@ -129,12 +130,24 @@ const QRCODE = "qrcode" func init() { Index.Merge(&ice.Context{Commands: map[string]*ice.Command{ - QRCODE: {Name: "qrcode text fg bg size auto", Help: "二维码", Action: map[string]*ice.Action{ + QRCODE: {Name: "qrcode text@key fg@key bg@key size auto", Help: "二维码", Action: map[string]*ice.Action{ ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { ice.AddRender(ice.RENDER_QRCODE, func(m *ice.Message, cmd string, args ...ice.Any) string { return m.Cmd(QRCODE, kit.Simple(args...)).Result() }) }}, + mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { + switch arg[0] { + case "text": + m.Push("text", "hi") + m.Push("text", "hello") + m.Push("text", "world") + case "fg", "bg": + m.Push("color", "red") + m.Push("color", "green") + m.Push("color", "blue") + } + }}, }, Hand: func(m *ice.Message, arg ...string) { m.Option(SIZE, kit.Select("240", arg, 3)) m.Option(BG, kit.Select(WHITE, arg, 2)) diff --git a/misc/git/status.go b/misc/git/status.go index c2de6756..1642871d 100644 --- a/misc/git/status.go +++ b/misc/git/status.go @@ -200,7 +200,7 @@ const STATUS = "status" func init() { Index.Merge(&ice.Context{Commands: map[string]*ice.Command{ - STATUS: {Name: "status repos@key auto", Help: "状态机", Action: map[string]*ice.Action{ + STATUS: {Name: "status repos auto", Help: "状态机", Action: map[string]*ice.Action{ mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) { switch arg[0] { case mdb.NAME, REPOS: