Fix shadowing luacheck warnings.

This commit is contained in:
Auke Kok 2017-02-19 21:26:07 -08:00
parent 18ac41f5f1
commit b8df93c540

View File

@ -36,30 +36,30 @@ local help = {
}
local commands = {
clear = function(output, params, context)
clear = function(output, params, c)
return ""
end,
append = function(output, params, context)
if not context.rw then
append = function(output, params, c)
if not c.rw then
return output .. "\nno write access"
end
local what, _ = get_cmd_params(params)
if what == "" then
return output .. "\nMissing file name"
end
context.writing = what
c.writing = what
return output .. "\n" .. "writing \"" .. what .. "\". Enter STOP on a line by itself to finish"
end,
write = function(output, params, context)
if not context.rw then
write = function(output, params, c)
if not c.rw then
return output .. "\nno write access"
end
local what, _ = get_cmd_params(params)
if what == "" then
return output .. "\nMissing file name"
end
context.writing = what
local meta = minetest.get_meta(context.pos)
c.writing = what
local meta = minetest.get_meta(c.pos)
local meta_files = meta:get_string("files")
if meta_files and meta_files ~= "" then
local files = minetest.parse_json(meta_files)
@ -70,11 +70,11 @@ local commands = {
end
return output .. "\n" .. "writing \"" .. what .. "\". Enter STOP on a line by itself to finish"
end,
remove = function(output, params, context)
if not context.rw then
remove = function(output, params, c)
if not c.rw then
return output .. "\nno write access"
end
local meta = minetest.get_meta(context.pos)
local meta = minetest.get_meta(c.pos)
local meta_files = meta:get_string("files")
if not meta_files or meta_files == "" then
return output .. "\nNo such file"
@ -89,8 +89,8 @@ local commands = {
meta:set_string("files", minetest.write_json(files))
return output .. "\n" .. "removed \"" .. first .. "\""
end,
list = function(output, params, context)
local meta = minetest.get_meta(context.pos)
list = function(output, params, c)
local meta = minetest.get_meta(c.pos)
local meta_files = meta:get_string("files")
local files
if not meta_files or meta_files == "" then
@ -105,11 +105,11 @@ local commands = {
end
return output
end,
echo = function(output, params, context)
echo = function(output, params, c)
return output .. "\n" .. params
end,
read = function(output, params, context)
local meta = minetest.get_meta(context.pos)
read = function(output, params, c)
local meta = minetest.get_meta(c.pos)
local meta_files = meta:get_string("files")
if not meta_files or meta_files == "" then
return output .. "\nNo such file"
@ -121,17 +121,16 @@ local commands = {
else
return output .. "\n" .. "No such file"
end
return output
end,
lock = function(output, params, context)
lock = function(output, params, c)
local meta = minetest.get_meta(context.pos)
meta:set_int("locked", 1)
return output .. "\n" .. "terminal locked"
end,
unlock = function(output, params, context)
unlock = function(output, params, c)
return output .. "\n" .. "unable to connect to authentication service"
end,
help = function(output, params, context)
help = function(output, params, c)
if params ~= "" then
local h, _ = get_cmd_params(params)
if help[h] then