diff --git a/rpc/repl.go b/rpc/repl.go index cb3d5ea..309b152 100644 --- a/rpc/repl.go +++ b/rpc/repl.go @@ -31,6 +31,7 @@ func RunREPL(f Fluter) { textSize := 10.0 var textCol image.Image = image.White var bgCol image.Image = image.Transparent + var taskStore = make(map[string]pixelflut.FlutTask) fmt.Print("[rán] REPL is active. ") printHelp() @@ -73,6 +74,22 @@ func RunREPL(f Fluter) { printTask = false } + case "store", "save": + printTask = false + if len(args) == 0 { + fmt.Println("must specify name") + } else { + taskStore[strings.Join(args, " ")] = t + } + continue + + case "load", "l": + if len(args) == 0 { + fmt.Println("must specify name") + } else { + t = taskStore[strings.Join(args, " ")] + } + case "offset", "of": if len(args) == 1 && args[0] == "rand" { t.RandOffset = true @@ -195,10 +212,12 @@ func RunREPL(f Fluter) { func printHelp() { fmt.Println(`available commands: - general + tasks start start fluting stop pause fluting status print current task + save store current task + load load previously stored task content i set image txt send text