diff --git a/models.go b/models.go index 1bea840..5677075 100644 --- a/models.go +++ b/models.go @@ -37,6 +37,7 @@ const ( ZapScriptCmdExecute = "execute" ZapScriptCmdDelay = "delay" ZapScriptCmdEvaluate = "evaluate" + ZapScriptCmdWrite = "write" ZapScriptCmdStop = "stop" ZapScriptCmdEcho = "echo" ZapScriptCmdControl = "control" @@ -99,6 +100,10 @@ type CmdLaunchArgs struct { Path string `json:"path" arg:"position=1"` } +type CmdWriteArgs struct { + Payload string `json:"payload" arg:"position=1"` +} + type CmdNotice struct { Loader *bool `json:"loader"` Text string `json:"text" arg:"position=1"` diff --git a/parser_test.go b/parser_test.go index 7901401..f7c6d2f 100644 --- a/parser_test.go +++ b/parser_test.go @@ -60,6 +60,18 @@ func TestParse(t *testing.T) { }, }, }, + { + name: "write command", + input: `**write:'**launch:/games/snes/zelda.sfc||**echo:written'`, + want: zapscript.Script{ + Cmds: []zapscript.Command{ + { + Name: zapscript.ZapScriptCmdWrite, + Args: []string{"**launch:/games/snes/zelda.sfc||**echo:written"}, + }, + }, + }, + }, { name: "two commands separated", input: `**first:1,2||**second:3,4`,