mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
e1d3530226
commit
ca064bcc17
@ -15,8 +15,13 @@ const DEBUG = "debug"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
DEBUG: {Name: "debug level=error,bench,debug,error,watch offset filter auto doc", Help: "后台日志", Actions: ice.Actions{
|
DEBUG: {Name: "debug level=error,bench,debug,error,watch offset filter auto reset doc", Help: "后台日志", Actions: ice.Actions{
|
||||||
"doc": {Help: "文档", Hand: func(m *ice.Message, arg ...string) { m.ProcessOpen("https://pkg.go.dev/std") }},
|
"doc": {Help: "文档", Hand: func(m *ice.Message, arg ...string) { m.ProcessOpen("https://pkg.go.dev/std") }},
|
||||||
|
"reset": {Help: "文档", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmd(nfs.CAT, ice.VAR_LOG+arg[0]+".log", func(line string, index int) {
|
||||||
|
m.ProcessRewrite("offset", index+2)
|
||||||
|
})
|
||||||
|
}},
|
||||||
}, Hand: func(m *ice.Message, arg ...string) {
|
}, Hand: func(m *ice.Message, arg ...string) {
|
||||||
offset, stats := kit.Int(kit.Select("0", arg, 1)), map[string]int{}
|
offset, stats := kit.Int(kit.Select("0", arg, 1)), map[string]int{}
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
@ -26,6 +31,9 @@ func init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
ls := strings.SplitN(line, ice.SP, 6)
|
ls := strings.SplitN(line, ice.SP, 6)
|
||||||
|
if len(ls) < 6 {
|
||||||
|
return
|
||||||
|
}
|
||||||
m.Push(mdb.TIME, ls[0]+ice.SP+ls[1]).Push(mdb.ID, ls[2])
|
m.Push(mdb.TIME, ls[0]+ice.SP+ls[1]).Push(mdb.ID, ls[2])
|
||||||
i := strings.LastIndex(ls[5], ice.SP)
|
i := strings.LastIndex(ls[5], ice.SP)
|
||||||
if strings.HasPrefix(ls[5][i+1:], ice.BASE) || strings.HasPrefix(ls[5][i+1:], ice.CORE) || strings.HasPrefix(ls[5][i+1:], ice.MISC) {
|
if strings.HasPrefix(ls[5][i+1:], ice.BASE) || strings.HasPrefix(ls[5][i+1:], ice.CORE) || strings.HasPrefix(ls[5][i+1:], ice.MISC) {
|
||||||
|
@ -10,10 +10,21 @@ import (
|
|||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
EXPR = "expr"
|
||||||
|
OPS = "(,){;}!=<>+-*/"
|
||||||
|
OPEN = "("
|
||||||
|
FIELD = ","
|
||||||
|
CLOSE = ")"
|
||||||
|
BEGIN = "{"
|
||||||
|
SPLIT = ";"
|
||||||
|
END = "}"
|
||||||
|
DISABLE = -1
|
||||||
|
)
|
||||||
|
|
||||||
var level = map[string]int{
|
var level = map[string]int{
|
||||||
"++": 100,
|
"++": 100,
|
||||||
"*": 30, "/": 30,
|
"+": 20, "-": 20, "*": 30, "/": 30,
|
||||||
"+": 20, "-": 20,
|
|
||||||
"<": 10, ">": 10, "<=": 10, ">=": 10, "==": 10, "!=": 10,
|
"<": 10, ">": 10, "<=": 10, ">=": 10, "==": 10, "!=": 10,
|
||||||
"(": 2, ")": 2,
|
"(": 2, ")": 2,
|
||||||
"=": 1,
|
"=": 1,
|
||||||
@ -306,16 +317,6 @@ func _parse_rest(split string, arg ...string) ([]string, []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
OPS = "{()}<!=>+-*/;"
|
|
||||||
EXPR = "expr"
|
|
||||||
BEGIN = "{"
|
|
||||||
SPLIT = ";"
|
|
||||||
FIELD = ","
|
|
||||||
OPEN = "("
|
|
||||||
CLOSE = ")"
|
|
||||||
END = "}"
|
|
||||||
DISABLE = -1
|
|
||||||
|
|
||||||
PWD = "pwd"
|
PWD = "pwd"
|
||||||
CMD = "cmd"
|
CMD = "cmd"
|
||||||
LET = "let"
|
LET = "let"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user