diff --git a/src/main/resources/assets/opencomputers/lua/rom/init.lua b/src/main/resources/assets/opencomputers/lua/rom/init.lua index 99afa57f3..e6e7417fd 100644 --- a/src/main/resources/assets/opencomputers/lua/rom/init.lua +++ b/src/main/resources/assets/opencomputers/lua/rom/init.lua @@ -11,7 +11,7 @@ computer.pushSignal("init") -- so libs know components are initialized. while true do require("term").clear() io.write(_OSVERSION .. " (" .. math.floor(computer.totalMemory() / 1024) .. "k RAM)\n") - local result, reason = os.execute(os.getenv("SHELL") .. " -") + local result, reason = os.execute(os.getenv("SHELL")) if not result then io.stderr:write((tostring(reason) or "unknown error") .. "\n") print("Press any key to continue.") diff --git a/src/main/resources/assets/opencomputers/lua/rom/lib/shell.lua b/src/main/resources/assets/opencomputers/lua/rom/lib/shell.lua index a8b0c20d6..c07df9ddd 100644 --- a/src/main/resources/assets/opencomputers/lua/rom/lib/shell.lua +++ b/src/main/resources/assets/opencomputers/lua/rom/lib/shell.lua @@ -152,9 +152,13 @@ function shell.parse(...) local options = {} for i = 1, params.n do local param = params[i] - if type(param) == "string" and unicode.sub(param, 1, 2) == "--" then - options[unicode.sub(param, 3)] = true - elseif type(param) == "string" and unicode.sub(param, 1, 1) == "-" then + if type(param) == "string" and unicode.sub(param, 1, 2) == "--" and param ~= "--" then + if param:match("%-%-(.-)=") ~= nil then + options[param:match("%-%-(.-)=")] = param:match("=(.*)") + else + options[unicode.sub(param, 3)] = true + end + elseif type(param) == "string" and unicode.sub(param, 1, 1) == "-" and param ~= "--" and param ~= "-" then for j = 2, unicode.len(param) do options[unicode.sub(param, j, j)] = true end