1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

pro status.go

This commit is contained in:
shaoying 2021-05-16 15:50:25 +08:00
parent 3d5eddec4f
commit 1fdaf183cd
2 changed files with 20 additions and 1 deletions

View File

@ -330,3 +330,5 @@ func (m *Message) Upload(dir string) {
kit.MergeURL2(m.Option(MSG_USERWEB), path.Join("/share/cache", up[0])))
}
}
func (m *Message) OptionFields(str string) { m.Option("fields", str) }

View File

@ -6,6 +6,7 @@ import (
ice "github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/cli"
"github.com/shylinux/icebergs/base/mdb"
kit "github.com/shylinux/toolkits"
)
@ -129,7 +130,7 @@ func init() {
m.Cmdy(cli.SYSTEM, GIT, ADD, m.Option(kit.MDB_FILE))
}}, OPT: {Name: "opt", Help: "优化"}, PRO: {Name: "pro", Help: "体验"},
COMMIT: {Name: "commit action=pro,opt,add comment=some", Help: "提交", Hand: func(m *ice.Message, arg ...string) {
COMMIT: {Name: "commit action=pro,opt,add comment=some@key", Help: "提交", Hand: func(m *ice.Message, arg ...string) {
if arg[0] == kit.MDB_ACTION {
m.Option(kit.MDB_TEXT, arg[1]+" "+arg[3])
} else {
@ -140,6 +141,22 @@ func init() {
m.Cmdy(cli.SYSTEM, GIT, COMMIT, "-am", m.Option(kit.MDB_TEXT))
m.ProcessBack()
}},
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
switch arg[0] {
case "name":
m.OptionFields("name,time")
m.Cmdy(REPOS)
case "comment":
ls := []string{}
ls = append(ls, kit.Split(m.Option(kit.MDB_FILE), " /")...)
m.Push(kit.MDB_TEXT, m.Option(kit.MDB_FILE))
for _, v := range ls {
m.Push(kit.MDB_TEXT, v)
}
}
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) == 0 {
m.Action(PULL, MAKE, PUSH)