new command: batch GET

We need this to speed up the initial load of the driver.
This commit is contained in:
Kartik K. Agaram 2023-01-07 14:43:38 -08:00
parent 7a1c556918
commit 4d81e495f8

View File

@ -234,6 +234,15 @@ function live.run(buf)
elseif cmd == 'GET' then
local binding = buf:match('^%S+%s+(%S+)')
live.send_to_driver(live.get_binding(binding))
elseif cmd == 'GET*' then
-- batch version of GET
local result = {}
for binding in buf:gmatch('%s+(%S+)') do
print(binding)
local val, _ = app.get_binding(binding)
table.insert(result, val)
end
app.send(table.concat(result, '\n--fw: definition boundary--\n'))
-- other commands go here
else
local binding = cmd