mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt chrome
This commit is contained in:
parent
8a972d3a0b
commit
1168b9edc2
36
misc/chrome/page.go
Normal file
36
misc/chrome/page.go
Normal file
@ -0,0 +1,36 @@
|
||||
package crx
|
||||
|
||||
import (
|
||||
ice "github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/icebergs/base/cli"
|
||||
"github.com/shylinux/icebergs/base/ctx"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
)
|
||||
|
||||
const Page = "page"
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{
|
||||
Configs: map[string]*ice.Config{
|
||||
Page: {Name: "page", Help: "网页", Value: kit.Data()},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
"/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{
|
||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||
if arg[0] == "get" {
|
||||
m.Option("top", "200")
|
||||
m.Echo("cli.runtime")
|
||||
return
|
||||
}
|
||||
if arg[0] == cli.RUN {
|
||||
m.Cmdy(arg[1:])
|
||||
return
|
||||
}
|
||||
m.Cmdy(ctx.COMMAND, arg)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
|
||||
}},
|
||||
},
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user