Commit d4dc2e0a authored by Eric's avatar Eric

update

parent 511013b5
...@@ -55,6 +55,7 @@ type Parser struct { ...@@ -55,6 +55,7 @@ type Parser struct {
command string command string
output string output string
cmdInputParser *CmdParser cmdInputParser *CmdParser
cmdOutputParser *CmdParser cmdOutputParser *CmdParser
...@@ -128,7 +129,6 @@ func (p *Parser) parseInputState(b []byte) []byte { ...@@ -128,7 +129,6 @@ func (p *Parser) parseInputState(b []byte) []byte {
} }
p.inputPreState = p.inputState p.inputPreState = p.inputState
if bytes.Contains(b, charEnter) { if bytes.Contains(b, charEnter) {
// 连续输入enter key, 结算上一条可能存在的命令结果 // 连续输入enter key, 结算上一条可能存在的命令结果
p.sendCommandRecord() p.sendCommandRecord()
...@@ -137,6 +137,7 @@ func (p *Parser) parseInputState(b []byte) []byte { ...@@ -137,6 +137,7 @@ func (p *Parser) parseInputState(b []byte) []byte {
p.parseCmdInput() p.parseCmdInput()
if cmd, ok := p.IsCommandForbidden(); !ok { if cmd, ok := p.IsCommandForbidden(); !ok {
fbdMsg := utils.WrapperWarn(fmt.Sprintf(i18n.T("Command `%s` is forbidden"), cmd)) fbdMsg := utils.WrapperWarn(fmt.Sprintf(i18n.T("Command `%s` is forbidden"), cmd))
_, _ = p.cmdOutputParser.WriteData([]byte(fbdMsg))
p.srvOutputChan <- []byte("\r\n" + fbdMsg) p.srvOutputChan <- []byte("\r\n" + fbdMsg)
p.cmdRecordChan <- [2]string{p.command, fbdMsg} p.cmdRecordChan <- [2]string{p.command, fbdMsg}
p.command = "" p.command = ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment