Bugfixes on CLI interactions

This commit is contained in:
Nathan Schneider
2021-12-20 21:28:54 -07:00
parent fe2d5fdb2a
commit cfef9b29b0
6 changed files with 40 additions and 19 deletions

View File

@ -1,9 +1,19 @@
--- @function modpol.copy_table
-- Returns a copy of the table inputted
function modpol.copy_table(t)
function modpol.util.copy_table(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
--- @function modpol.copy_table
-- Returns the number of elements in a pairs table
function modpol.util.num_pairs(t)
local i = 0
for k,v in pairs(t) do
i = i + 1
end
return i
end