forked from x/icebergs
pro git
This commit is contained in:
parent
8399542454
commit
3d5eddec4f
@ -7,6 +7,7 @@ import (
|
|||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
"github.com/shylinux/icebergs/base/cli"
|
"github.com/shylinux/icebergs/base/cli"
|
||||||
"github.com/shylinux/icebergs/base/ctx"
|
"github.com/shylinux/icebergs/base/ctx"
|
||||||
|
"github.com/shylinux/icebergs/base/mdb"
|
||||||
"github.com/shylinux/icebergs/base/nfs"
|
"github.com/shylinux/icebergs/base/nfs"
|
||||||
"github.com/shylinux/icebergs/core/code"
|
"github.com/shylinux/icebergs/core/code"
|
||||||
kit "github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
@ -60,11 +61,12 @@ const SPIDE = "spide"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||||
SPIDE: {Name: "spide name auto", Help: "构架图", Meta: kit.Dict(
|
SPIDE: {Name: "spide name@key auto", Help: "构架图", Meta: kit.Dict(
|
||||||
kit.MDB_DISPLAY, "/plugin/story/spide.js",
|
kit.MDB_DISPLAY, "/plugin/story/spide.js",
|
||||||
), Action: map[string]*ice.Action{
|
), Action: map[string]*ice.Action{
|
||||||
ctx.COMMAND: {Name: "ctx.command"},
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
code.INNER: {Name: "web.code.inner"},
|
m.Cmdy(REPOS)
|
||||||
|
}}, ctx.COMMAND: {Name: "ctx.command"}, code.INNER: {Name: "web.code.inner"},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) == 0 { // 仓库列表
|
if len(arg) == 0 { // 仓库列表
|
||||||
m.Cmdy(REPOS)
|
m.Cmdy(REPOS)
|
||||||
|
@ -91,7 +91,10 @@ const (
|
|||||||
MAKE = "make"
|
MAKE = "make"
|
||||||
PUSH = "push"
|
PUSH = "push"
|
||||||
|
|
||||||
ADD = "add"
|
ADD = "add"
|
||||||
|
OPT = "opt"
|
||||||
|
PRO = "pro"
|
||||||
|
|
||||||
DIFF = "diff"
|
DIFF = "diff"
|
||||||
COMMIT = "commit"
|
COMMIT = "commit"
|
||||||
)
|
)
|
||||||
@ -124,8 +127,9 @@ func init() {
|
|||||||
ADD: {Name: "add", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
ADD: {Name: "add", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(cli.CMD_DIR, _repos_path(m.Option(kit.MDB_NAME)))
|
m.Option(cli.CMD_DIR, _repos_path(m.Option(kit.MDB_NAME)))
|
||||||
m.Cmdy(cli.SYSTEM, GIT, ADD, m.Option(kit.MDB_FILE))
|
m.Cmdy(cli.SYSTEM, GIT, ADD, m.Option(kit.MDB_FILE))
|
||||||
}},
|
}}, OPT: {Name: "opt", Help: "优化"}, PRO: {Name: "pro", Help: "体验"},
|
||||||
COMMIT: {Name: "commit action=opt,add comment=some", Help: "提交", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
|
COMMIT: {Name: "commit action=pro,opt,add comment=some", Help: "提交", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if arg[0] == kit.MDB_ACTION {
|
if arg[0] == kit.MDB_ACTION {
|
||||||
m.Option(kit.MDB_TEXT, arg[1]+" "+arg[3])
|
m.Option(kit.MDB_TEXT, arg[1]+" "+arg[3])
|
||||||
} else {
|
} else {
|
||||||
|
@ -3,6 +3,8 @@ package git
|
|||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
"github.com/shylinux/icebergs/base/ctx"
|
"github.com/shylinux/icebergs/base/ctx"
|
||||||
|
"github.com/shylinux/icebergs/base/mdb"
|
||||||
|
"github.com/shylinux/icebergs/core/code"
|
||||||
kit "github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -13,7 +15,9 @@ func init() {
|
|||||||
TREND: {Name: "trend name@key begin_time@date auto", Help: "趋势图", Meta: kit.Dict(
|
TREND: {Name: "trend name@key begin_time@date auto", Help: "趋势图", Meta: kit.Dict(
|
||||||
kit.MDB_DISPLAY, "/plugin/story/trend.js",
|
kit.MDB_DISPLAY, "/plugin/story/trend.js",
|
||||||
), Action: map[string]*ice.Action{
|
), Action: map[string]*ice.Action{
|
||||||
ctx.COMMAND: {Name: "ctx.command"},
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(REPOS, ice.OptionFields("name,time"))
|
||||||
|
}}, ctx.COMMAND: {Name: "ctx.command"}, code.INNER: {Name: "web.code.inner"},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) == 0 { // 仓库列表
|
if len(arg) == 0 { // 仓库列表
|
||||||
m.Cmdy(REPOS)
|
m.Cmdy(REPOS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user