From 7974ff97023dd7fc5569ebe7f01f7103b9153845 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 18 Mar 2020 12:26:29 +1100 Subject: [PATCH] made the shell able to handle table values --- lib/shell.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/shell.lua b/lib/shell.lua index f012718..9a69cfe 100644 --- a/lib/shell.lua +++ b/lib/shell.lua @@ -1,3 +1,4 @@ +local serial = require "serialization" local shell = {} shell.include = {"shutil"} local function shindex(self,k) @@ -25,7 +26,16 @@ function shell.interactive() local rt = {pcall(f)} local rs = table.remove(rt,1) for k,v in pairs(rt) do - print(tostring(v)) + if type(v) == "table" then + local w, s = pcall(serial.serialize,v) + if w then + print(s) + else + print(tostring(v)) + end + else + print(tostring(v)) + end end end end