1
0
forked from x/ContextOS

fix code lost

This commit is contained in:
shaoying 2019-09-08 08:57:02 +08:00
parent f39b7a723b
commit 412631a028

View File

@ -624,7 +624,9 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
format := kit.Select(m.Conf("time", "format"), m.Option("time_format"))
t, stamp := time.Now(), true
if len(arg) > 0 {
if i, e := strconv.ParseInt(arg[0], 10, 64); e == nil {
if arg[0] == "show" {
stamp = false
} else if i, e := strconv.ParseInt(arg[0], 10, 64); e == nil {
t, stamp, arg = time.Unix(int64(i/int64(m.Confi("time", "unit"))), 0), false, arg[1:]
} else if n, e := time.ParseInLocation(format, arg[0], time.Local); e == nil {
t, arg = n, arg[1:]
@ -706,8 +708,8 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
return
}},
"proc": &ctx.Command{Name: "proc", Help: "进程管理", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
m.Cmdy("cli.system", "cmd_parse", "cut", "ps", kit.Select("ax", arg, 0))
if len(arg) > 0 {
m.Cmdy("cli.system", "ps", kit.Select("ax", arg, 0), "cmd_parse", "cut")
if len(arg) > 1 {
m.Cmd("select", "reg", "COMMAND", arg[1])
}
return
@ -774,6 +776,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
})
m.Cmdp(0, []string{"go build"}, []string{"cli.system", "go", "get"}, list)
case "stats":
// 代码统计
m.Cmdy("nfs.dir", kit.Select("src", arg, 1), "dir_deep", "dir_type", "file", "dir_sort", "line", "int_r", "dir_select", "group", "")
case "stat":
// 代码统计
m.Cmdy("nfs.dir", "src", "dir_deep", "dir_type", "file", "dir_sort", "line", "int_r")