mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 18:22:02 +08:00
opt autogen
This commit is contained in:
parent
8fd16ff52c
commit
8e3dd7bb4a
@ -82,7 +82,6 @@ func (f *Frame) prompt(m *ice.Message, list ...string) *Frame {
|
|||||||
list = append(list, f.ps1...)
|
list = append(list, f.ps1...)
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Sleep("30ms")
|
|
||||||
fmt.Fprintf(f.stdout, "\r")
|
fmt.Fprintf(f.stdout, "\r")
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
switch v {
|
switch v {
|
||||||
|
@ -40,14 +40,14 @@ import (
|
|||||||
type {{.Option "name"}} struct {
|
type {{.Option "name"}} struct {
|
||||||
ice.{{.Option "type"}}
|
ice.{{.Option "type"}}
|
||||||
|
|
||||||
list string {{.Option "list"}}
|
list string {{.Option "tag"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h {{.Option "name"}}) List(m *ice.Message, arg ...string) {
|
func (h {{.Option "name"}}) List(m *ice.Message, arg ...string) {
|
||||||
h.{{.Option "type"}}.List(m, arg...)
|
h.{{.Option "type"}}.List(m, arg...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.Cmd("{{.Option "key"}}", &{{.Option "name"}}{}) }
|
func init() { ice.Cmd("{{.Option "key"}}", {{.Option "name"}}{}) }
|
||||||
`, m)
|
`, m)
|
||||||
m.Cmd(nfs.SAVE, dir, string(buf))
|
m.Cmd(nfs.SAVE, dir, string(buf))
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ const AUTOGEN = "autogen"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||||
AUTOGEN: {Name: "autogen path auto create binpack script", Help: "生成", Action: map[string]*ice.Action{
|
AUTOGEN: {Name: "autogen path auto create binpack script", Help: "生成", Action: map[string]*ice.Action{
|
||||||
mdb.CREATE: {Name: "create main=src/main.go@key key= zone= type=Zone,Hash,List,Data name=hi list= help=", Help: "模块", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create main=src/main.go@key key= zone= type=Zone,Hash,Data name=hi list= help=", Help: "模块", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_defs(m, "zone", m.Option("name"), "help", m.Option("name"))
|
_defs(m, "zone", m.Option("name"), "help", m.Option("name"))
|
||||||
_defs(m, "key", kit.Keys("web.code", m.Option("zone"), m.Option("name")))
|
_defs(m, "key", kit.Keys("web.code", m.Option("zone"), m.Option("name")))
|
||||||
switch m.Option("type") {
|
switch m.Option("type") {
|
||||||
@ -151,12 +151,10 @@ func init() {
|
|||||||
_defs(m, "list", "list zone id auto insert")
|
_defs(m, "list", "list zone id auto insert")
|
||||||
case "Hash":
|
case "Hash":
|
||||||
_defs(m, "list", "list hash auto create")
|
_defs(m, "list", "list hash auto create")
|
||||||
case "List":
|
|
||||||
_defs(m, "list", "list id auto insert")
|
|
||||||
case "Data":
|
case "Data":
|
||||||
_defs(m, "list", "list path auto upload")
|
_defs(m, "list", "list path auto upload")
|
||||||
}
|
}
|
||||||
m.Option("list", kit.Format("`name:\"%s\" help:\"%s\"`", m.Option("list"), m.Option("help")))
|
m.Option("tag", kit.Format("`name:\"%s\" help:\"%s\"`", m.Option("list"), m.Option("help")))
|
||||||
|
|
||||||
if p := path.Join(kit.SSH_SRC, m.Option(kit.MDB_ZONE), kit.Keys(m.Option(kit.MDB_NAME), SHY)); !kit.FileExists(p) {
|
if p := path.Join(kit.SSH_SRC, m.Option(kit.MDB_ZONE), kit.Keys(m.Option(kit.MDB_NAME), SHY)); !kit.FileExists(p) {
|
||||||
_autogen_script(m, p)
|
_autogen_script(m, p)
|
||||||
|
@ -33,7 +33,7 @@ func init() {
|
|||||||
nfs.SAVE: {Name: "save type file path", Help: "保存", Hand: func(m *ice.Message, arg ...string) {
|
nfs.SAVE: {Name: "save type file path", Help: "保存", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(nfs.SAVE, path.Join(m.Option(kit.MDB_PATH), m.Option(kit.MDB_FILE)))
|
m.Cmdy(nfs.SAVE, path.Join(m.Option(kit.MDB_PATH), m.Option(kit.MDB_FILE)))
|
||||||
}},
|
}},
|
||||||
AUTOGEN: {Name: "create main=src/main.go@key key= zone= type=Zone,Hash,List,Data name=hi list= help=", Help: "模块", Hand: func(m *ice.Message, arg ...string) {
|
AUTOGEN: {Name: "create main=src/main.go@key key= zone= type=Zone,Hash,Data name=hi list= help=", Help: "模块", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(AUTOGEN, mdb.CREATE, arg)
|
m.Cmdy(AUTOGEN, mdb.CREATE, arg)
|
||||||
}},
|
}},
|
||||||
COMPILE: {Name: "compile", Help: "编译", Hand: func(m *ice.Message, arg ...string) {
|
COMPILE: {Name: "compile", Help: "编译", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -59,7 +59,7 @@ func (m *Message) PushAnchor(arg ...interface{}) { // [name] link
|
|||||||
}
|
}
|
||||||
func (m *Message) PushButton(arg ...string) {
|
func (m *Message) PushButton(arg ...string) {
|
||||||
if !m.IsCliUA() {
|
if !m.IsCliUA() {
|
||||||
m.Push(kit.MDB_ACTION, Render(m, RENDER_BUTTON, kit.Join(arg)))
|
m.Push(kit.MDB_ACTION, Render(m, RENDER_BUTTON, strings.ToLower(kit.Join(arg))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *Message) PushScript(arg ...string) *Message { // [type] text...
|
func (m *Message) PushScript(arg ...string) *Message { // [type] text...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user