mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-03 18:47:56 +01:00
fix regexp, add dump argument to show parsed command
This commit is contained in:
parent
dc8cba79da
commit
00b88f7f13
@ -83,7 +83,7 @@ func getSourceStr(source string, w *syntax.Word) string {
|
||||
return source[offset:end]
|
||||
}
|
||||
|
||||
var ValidMetaCmdRe = regexp.MustCompile("^/([a-z][a-z0-9_-]*)(:[a-z][a-z0-9_-]*)?$")
|
||||
var ValidMetaCmdRe = regexp.MustCompile("^/([a-z][a-z0-9_-]*)(?::([a-z][a-z0-9_-]*))?$")
|
||||
|
||||
type BareMetaCmdDecl struct {
|
||||
CmdStr string
|
||||
@ -206,5 +206,8 @@ func EvalMetaCommand(ctx context.Context, origPk *scpacket.FeCommandPacketType)
|
||||
}
|
||||
rtnPk.Args = append(rtnPk.Args, literalVal)
|
||||
}
|
||||
if resolveBool(rtnPk.Kwargs["dump"], false) {
|
||||
DumpPacket(rtnPk)
|
||||
}
|
||||
return rtnPk, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user