Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not table.pack then table.pack = function(...) return { n = select("#", ...), ... } end end
- if not table.unpack then table.unpack = unpack end
- local load = load if _VERSION:find("5.1") then load = function(x, n, _, env) local f, e = loadstring(x, n) if not f then return f, e end if env then setfenv(f, env) end return f end end
- local _select, _unpack, _pack, _error = select, table.unpack, table.pack, error
- local _libs = {}
- local _3d_1, _2f3d_1, _3c_1, _3c3d_1, _3e_1, _3e3d_1, _2b_1, _2d_1, _25_1, _2e2e_1, _G1, arg_23_1, len_23_1, error1, getmetatable1, load1, next1, print1, getIdx1, setIdx_21_1, setmetatable1, tostring1, type_23_1, n1, slice1, find1, format1, gsub1, lower1, match1, sub1, upper1, concat1, remove1, unpack1, car1, cdr1, list1, _21_1, arg1, constVal1, apply1, first1, list_3f_1, empty_3f_1, string_3f_1, number_3f_1, key_3f_1, nil_3f_1, type1, neq_3f_1, map1, keys1, put_21_1, eq_3f_1, pretty1, min1, car2, cdr2, reduce1, map2, flatMap1, partition1, filter1, any1, elem_3f_1, last1, init1, nth1, nths1, pushCdr_21_1, removeNth_21_1, append1, flatten1, cadr1, caddr1, charAt1, split1, trim1, display1, assoc_2d3e_struct1, merge1, keys2, values1, exit1, getenv1, succ1, pred1, fail_21_1, exit_21_1, const1, self1, create1, resume1, open1, getName1, combine1, isReadOnly1, move1, copy1, delete1, isDir1, getFreeSpace1, getSize1, list2, exists1, makeDir1, getDir1, current1, day1, sleep1, setAlarm1, pullEventRaw1, clock1, time1, cancelTimer1, startTimer1, cancelAlarm1, queueEvent1, resolve1, log_21_1, createVfs1, mountPath1, canonicalise1, createRealfs1, create2, createCoroutine_21_1, eventWhitelist1, next_21_1, envWhitelist1, createEnv1, config1, coloredAnsi1, colored_3f_1, colored1, create3, setAction1, addAction1, addArgument_21_1, addHelp_21_1, usageNarg_21_1, usage_21_1, usageError_21_1, helpArgs_21_1, help_21_1, matcher1, parse_21_1, args1, run1
- _3d_1 = function(v1, v2) return v1 == v2 end
- _2f3d_1 = function(v1, v2) return v1 ~= v2 end
- _3c_1 = function(v1, v2) return v1 < v2 end
- _3c3d_1 = function(v1, v2) return v1 <= v2 end
- _3e_1 = function(v1, v2) return v1 > v2 end
- _3e3d_1 = function(v1, v2) return v1 >= v2 end
- _2b_1 = function(...) local t = ... for i = 2, _select('#', ...) do t = t + _select(i, ...) end return t end
- _2d_1 = function(...) local t = ... for i = 2, _select('#', ...) do t = t - _select(i, ...) end return t end
- _25_1 = function(...) local t = ... for i = 2, _select('#', ...) do t = t % _select(i, ...) end return t end
- _2e2e_1 = function(...) local n = _select('#', ...) local t = _select(n, ...) for i = n - 1, 1, -1 do t = _select(i, ...) .. t end return t end
- _G1 = _G
- arg_23_1 = arg or {...}
- len_23_1 = function(v1) return #v1 end
- error1 = error
- getmetatable1 = getmetatable
- load1 = load
- next1 = next
- print1 = print
- getIdx1 = function(v1, v2) return v1[v2] end
- setIdx_21_1 = function(v1, v2, v3) v1[v2] = v3 end
- setmetatable1 = setmetatable
- tostring1 = tostring
- type_23_1 = type
- n1 = (function(x)
- if type_23_1(x) == "table" then
- return x["n"]
- else
- return #x
- end
- end)
- slice1 = (function(xs, start, finish)
- if not finish then
- finish = xs["n"]
- if not finish then
- finish = #xs
- end
- end
- local len = (finish - start) + 1
- if len < 0 then
- len = 0
- end
- local out, i, j = ({["tag"]="list",["n"]=len}), 1, start
- while j <= finish do
- out[i] = xs[j]
- i, j = i + 1, j + 1
- end
- return out
- end)
- find1 = string.find
- format1 = string.format
- gsub1 = string.gsub
- lower1 = string.lower
- match1 = string.match
- sub1 = string.sub
- upper1 = string.upper
- concat1 = table.concat
- remove1 = table.remove
- unpack1 = table.unpack
- car1 = (function(xs)
- return xs[1]
- end)
- cdr1 = (function(xs)
- return slice1(xs, 2)
- end)
- list1 = (function(...)
- local xs = _pack(...) xs.tag = "list"
- return xs
- end)
- _21_1 = (function(expr)
- return not expr
- end)
- if nil == arg_23_1 then
- arg1 = ({tag = "list", n = 0})
- else
- arg_23_1["tag"] = "list"
- if not arg_23_1["n"] then
- arg_23_1["n"] = #arg_23_1
- end
- arg1 = arg_23_1
- end
- constVal1 = (function(val)
- if type_23_1(val) == "table" then
- local tag = val["tag"]
- if tag == "number" then
- return val["value"]
- elseif tag == "string" then
- return val["value"]
- else
- return val
- end
- else
- return val
- end
- end)
- apply1 = (function(f, ...)
- local _n = _select("#", ...) - 1
- local xss, xs
- if _n > 0 then
- xss = { tag="list", n=_n, _unpack(_pack(...), 1, _n)}
- xs = select(_n + 1, ...)
- else
- xss = { tag="list", n=0}
- xs = ...
- end
- local args = (function()
- local _offset, _result, _temp = 0, {tag="list",n=0}
- _temp = xss
- for _c = 1, _temp.n do _result[0 + _c + _offset] = _temp[_c] end
- _offset = _offset + _temp.n
- _temp = xs
- for _c = 1, _temp.n do _result[0 + _c + _offset] = _temp[_c] end
- _offset = _offset + _temp.n
- _result.n = _offset + 0
- return _result
- end)()
- return f(unpack1(args, 1, n1(args)))
- end)
- first1 = (function(...)
- local rest = _pack(...) rest.tag = "list"
- return rest[1]
- end)
- list_3f_1 = (function(x)
- return type1(x) == "list"
- end)
- empty_3f_1 = (function(x)
- local xt = type1(x)
- if xt == "list" then
- return x["n"] == 0
- elseif xt == "string" then
- return #x == 0
- else
- return false
- end
- end)
- string_3f_1 = (function(x)
- return type_23_1(x) == "string" or type_23_1(x) == "table" and x["tag"] == "string"
- end)
- number_3f_1 = (function(x)
- return type_23_1(x) == "number" or type_23_1(x) == "table" and x["tag"] == "number"
- end)
- key_3f_1 = (function(x)
- return type1(x) == "key"
- end)
- nil_3f_1 = (function(x)
- return type_23_1(x) == "nil"
- end)
- type1 = (function(val)
- local ty = type_23_1(val)
- if ty == "table" then
- return val["tag"] or "table"
- else
- return ty
- end
- end)
- neq_3f_1 = (function(x, y)
- return _21_1(eq_3f_1(x, y))
- end)
- map1 = (function(f, x)
- local out = ({tag = "list", n = 0})
- local temp = n1(x)
- local temp1 = 1
- while temp1 <= temp do
- out[temp1] = f(x[temp1])
- temp1 = temp1 + 1
- end
- out["n"] = n1(x)
- return out
- end)
- keys1 = (function(x)
- local out, n = ({tag = "list", n = 0}), 0
- local temp, _ = next1(x)
- while temp ~= nil do
- n = 1 + n
- out[n] = temp
- temp, _ = next1(x, temp)
- end
- out["n"] = n
- return unpack1(out, 1, out["n"])
- end)
- put_21_1 = (function(t, typs, l)
- while not (list_3f_1(typs) and n1(typs) == 1) do
- local x, y = car1(typs), cdr1(typs)
- if t[x] then
- t, typs = t[x], y
- else
- t[x] = ({})
- t, typs = t[x], y
- end
- end
- t[car1(typs)] = l
- return nil
- end)
- eq_3f_1 = setmetatable1(({["lookup"]=({})}), ({["__call"]=(function(temp_this, x, y)
- local temp_method
- local temp = temp_this["lookup"]
- if temp then
- local temp1 = temp[type1(x)]
- if temp1 then
- temp_method = temp1[type1(y)] or nil
- else
- temp_method = nil
- end
- else
- temp_method = nil
- end
- if not temp_method then
- if temp_this["default"] then
- temp_method = temp_this["default"]
- else
- error1("No matching method to call for " .. (type1(x) .. " ") .. (type1(y) .. " ") .. "\nthere are methods to call for " .. keys1(temp_this["lookup"]))
- end
- end
- return temp_method(x, y)
- end)}))
- put_21_1(eq_3f_1, list1("lookup", "list", "list"), (function(x, y)
- if n1(x) ~= n1(y) then
- return false
- else
- local equal = true
- local temp = n1(x)
- local temp1 = 1
- while temp1 <= temp do
- if neq_3f_1(x[temp1], y[temp1]) then
- equal = false
- end
- temp1 = temp1 + 1
- end
- return equal
- end
- end))
- put_21_1(eq_3f_1, list1("lookup", "table", "table"), (function(x, y)
- local equal = true
- local temp, v = next1(x)
- while temp ~= nil do
- if neq_3f_1(v, y[temp]) then
- equal = false
- end
- temp, v = next1(x, temp)
- end
- return equal
- end))
- put_21_1(eq_3f_1, list1("lookup", "symbol", "symbol"), (function(x, y)
- return x["contents"] == y["contents"]
- end))
- put_21_1(eq_3f_1, list1("lookup", "string", "symbol"), (function(x, y)
- return x == y["contents"]
- end))
- put_21_1(eq_3f_1, list1("lookup", "symbol", "string"), (function(x, y)
- return x["contents"] == y
- end))
- put_21_1(eq_3f_1, list1("lookup", "key", "string"), (function(x, y)
- return x["value"] == y
- end))
- put_21_1(eq_3f_1, list1("lookup", "string", "key"), (function(x, y)
- return x == y["value"]
- end))
- put_21_1(eq_3f_1, list1("lookup", "key", "key"), (function(x, y)
- return x["value"] == y["value"]
- end))
- put_21_1(eq_3f_1, list1("lookup", "number", "number"), (function(x, y)
- return constVal1(x) == constVal1(y)
- end))
- put_21_1(eq_3f_1, list1("lookup", "string", "string"), (function(x, y)
- return constVal1(x) == constVal1(y)
- end))
- eq_3f_1["default"] = (function(x, y)
- return false
- end)
- local original = getmetatable1(eq_3f_1)["__call"]
- getmetatable1(eq_3f_1)["__call"] = (function(self, x, y)
- if x == y then
- return true
- else
- return original(self, x, y)
- end
- end)
- pretty1 = setmetatable1(({["lookup"]=({})}), ({["__call"]=(function(temp_this, x)
- local temp_method
- local temp = temp_this["lookup"]
- if temp then
- temp_method = temp[type1(x)] or nil
- else
- temp_method = nil
- end
- if not temp_method then
- if temp_this["default"] then
- temp_method = temp_this["default"]
- else
- error1("No matching method to call for " .. (type1(x) .. " ") .. "\nthere are methods to call for " .. keys1(temp_this["lookup"]))
- end
- end
- return temp_method(x)
- end)}))
- put_21_1(pretty1, list1("lookup", "list"), (function(xs)
- return "(" .. concat1(map1(pretty1, xs), " ") .. ")"
- end))
- put_21_1(pretty1, list1("lookup", "symbol"), (function(x)
- return x["contents"]
- end))
- put_21_1(pretty1, list1("lookup", "key"), (function(x)
- return ":" .. x["value"]
- end))
- put_21_1(pretty1, list1("lookup", "number"), (function(x)
- return tostring1(constVal1(x))
- end))
- put_21_1(pretty1, list1("lookup", "string"), (function(x)
- return format1("%q", constVal1(x))
- end))
- put_21_1(pretty1, list1("lookup", "table"), (function(x)
- local out = ({tag = "list", n = 0})
- local temp, v = next1(x)
- while temp ~= nil do
- local _offset, _result, _temp = 0, {tag="list",n=0}
- _result[1 + _offset] = pretty1(temp) .. " " .. pretty1(v)
- _temp = out
- for _c = 1, _temp.n do _result[1 + _c + _offset] = _temp[_c] end
- _offset = _offset + _temp.n
- _result.n = _offset + 1
- out = _result
- temp, v = next1(x, temp)
- end
- return "{" .. (concat1(out, " ") .. "}")
- end))
- pretty1["default"] = (function(x)
- return tostring1(x)
- end)
- min1 = math.min
- car2 = (function(x)
- local temp = type1(x)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "x", "list", temp), 2)
- end
- return car1(x)
- end)
- cdr2 = (function(x)
- local temp = type1(x)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "x", "list", temp), 2)
- end
- if empty_3f_1(x) then
- return ({tag = "list", n = 0})
- else
- return cdr1(x)
- end
- end)
- reduce1 = (function(f, z, xs)
- local temp = type1(f)
- if temp ~= "function" then
- error1(format1("bad argument %s (expected %s, got %s)", "f", "function", temp), 2)
- end
- local start = 1
- if nil_3f_1(xs) and list_3f_1(z) then
- start = 2
- xs = z
- z = car2(z)
- end
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- local accum = z
- local temp = n1(xs)
- local temp1 = start
- while temp1 <= temp do
- accum = f(accum, nth1(xs, temp1))
- temp1 = temp1 + 1
- end
- return accum
- end)
- map2 = (function(fn, ...)
- local xss = _pack(...) xss.tag = "list"
- local ns
- local out = ({tag = "list", n = 0})
- local temp = n1(xss)
- local temp1 = 1
- while temp1 <= temp do
- if _21_1(list_3f_1(nth1(xss, temp1))) then
- error1("not a list: " .. pretty1(nth1(xss, temp1)) .. " (it's a " .. type1(nth1(xss, temp1)) .. ")")
- end
- pushCdr_21_1(out, n1(nth1(xss, temp1)))
- temp1 = temp1 + 1
- end
- ns = out
- local out = ({tag = "list", n = 0})
- local temp = apply1(min1, ns)
- local temp1 = 1
- while temp1 <= temp do
- pushCdr_21_1(out, apply1(fn, nths1(xss, temp1)))
- temp1 = temp1 + 1
- end
- return out
- end)
- flatMap1 = (function(fn, ...)
- local xss = _pack(...) xss.tag = "list"
- return flatten1(apply1(map2, fn, xss))
- end)
- partition1 = (function(p, xs)
- local temp = type1(p)
- if temp ~= "function" then
- error1(format1("bad argument %s (expected %s, got %s)", "p", "function", temp), 2)
- end
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- local passed, failed = ({tag = "list", n = 0}), ({tag = "list", n = 0})
- local temp = n1(xs)
- local temp1 = 1
- while temp1 <= temp do
- local x = nth1(xs, temp1)
- pushCdr_21_1((function()
- if p(x) then
- return passed
- else
- return failed
- end
- end)(), x)
- temp1 = temp1 + 1
- end
- return unpack1(list1(passed, failed), 1, 2)
- end)
- filter1 = (function(p, xs)
- return first1(partition1(p, xs))
- end)
- any1 = (function(p, xs)
- local temp = type1(p)
- if temp ~= "function" then
- error1(format1("bad argument %s (expected %s, got %s)", "p", "function", temp), 2)
- end
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- local len = n1(xs)
- local i = 1
- while true do
- if i > len then
- return false
- elseif p(nth1(xs, i)) then
- return true
- else
- i = i + 1
- end
- end
- end)
- elem_3f_1 = (function(x, xs)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- return any1((function(y)
- return eq_3f_1(x, y)
- end), xs)
- end)
- last1 = (function(xs)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- return xs[n1(xs)]
- end)
- init1 = (function(xs)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- return slice1(xs, 1, n1(xs) - 1)
- end)
- nth1 = (function(xs, idx)
- if idx >= 0 then
- return xs[idx]
- else
- return xs[xs["n"] + 1 + idx]
- end
- end)
- nths1 = (function(xss, idx)
- local out = ({tag = "list", n = 0})
- local temp = n1(xss)
- local temp1 = 1
- while temp1 <= temp do
- pushCdr_21_1(out, nth1(nth1(xss, temp1), idx))
- temp1 = temp1 + 1
- end
- return out
- end)
- pushCdr_21_1 = (function(xs, val)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- local len = n1(xs) + 1
- xs["n"] = len
- xs[len] = val
- return xs
- end)
- removeNth_21_1 = (function(li, idx)
- local temp = type1(li)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "li", "list", temp), 2)
- end
- li["n"] = li["n"] - 1
- return remove1(li, idx)
- end)
- append1 = (function(xs, ys)
- local _offset, _result, _temp = 0, {tag="list",n=0}
- _temp = xs
- for _c = 1, _temp.n do _result[0 + _c + _offset] = _temp[_c] end
- _offset = _offset + _temp.n
- _temp = ys
- for _c = 1, _temp.n do _result[0 + _c + _offset] = _temp[_c] end
- _offset = _offset + _temp.n
- _result.n = _offset + 0
- return _result
- end)
- flatten1 = (function(xss)
- return reduce1(append1, ({tag = "list", n = 0}), xss)
- end)
- cadr1 = (function(xs)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- return xs[2]
- end)
- caddr1 = (function(xs)
- local temp = type1(xs)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "xs", "list", temp), 2)
- end
- return xs[3]
- end)
- charAt1 = (function(xs, x)
- return sub1(xs, x, x)
- end)
- split1 = (function(text, pattern, limit)
- local out, loop, start = ({tag = "list", n = 0}), true, 1
- while loop do
- local pos = list1(find1(text, pattern, start))
- local nstart, nend = car2(pos), cadr1(pos)
- if nstart == nil or limit and n1(out) >= limit then
- loop = false
- pushCdr_21_1(out, sub1(text, start, n1(text)))
- start = n1(text) + 1
- elseif nstart > #text then
- if start <= #text then
- pushCdr_21_1(out, sub1(text, start, #text))
- end
- loop = false
- elseif nend < nstart then
- pushCdr_21_1(out, sub1(text, start, nstart))
- start = nstart + 1
- else
- pushCdr_21_1(out, sub1(text, start, nstart - 1))
- start = nend + 1
- end
- end
- return out
- end)
- trim1 = (function(str)
- return (gsub1(gsub1(str, "^%s+", ""), "%s+$", ""))
- end)
- display1 = (function(x)
- if type_23_1(x) == "string" then
- return x
- elseif type_23_1(x) == "table" and x["tag"] == "string" then
- return x["value"]
- else
- return pretty1(x)
- end
- end)
- assoc_2d3e_struct1 = (function(list)
- local temp = type1(list)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "list", "list", temp), 2)
- end
- local ret = ({})
- local temp = n1(list)
- local temp1 = 1
- while temp1 <= temp do
- local x = list[temp1]
- local hd
- if key_3f_1(car2(x)) then
- hd = car2(x)["value"]
- else
- hd = car2(x)
- end
- if _21_1(ret[hd]) then
- ret[hd] = cadr1(x)
- end
- temp1 = temp1 + 1
- end
- return ret
- end)
- merge1 = (function(...)
- local structs = _pack(...) structs.tag = "list"
- local out = ({})
- local temp = n1(structs)
- local temp1 = 1
- while temp1 <= temp do
- local st = structs[temp1]
- local temp2, v = next1(st)
- while temp2 ~= nil do
- out[temp2] = v
- temp2, v = next1(st, temp2)
- end
- temp1 = temp1 + 1
- end
- return out
- end)
- keys2 = (function(st)
- local out = ({tag = "list", n = 0})
- local temp, _ = next1(st)
- while temp ~= nil do
- pushCdr_21_1(out, temp)
- temp, _ = next1(st, temp)
- end
- return out
- end)
- values1 = (function(st)
- local out = ({tag = "list", n = 0})
- local temp, v = next1(st)
- while temp ~= nil do
- pushCdr_21_1(out, v)
- temp, v = next1(st, temp)
- end
- return out
- end)
- exit1 = os.exit
- getenv1 = os.getenv
- succ1 = (function(x)
- return x + 1
- end)
- pred1 = (function(x)
- return x - 1
- end)
- fail_21_1 = (function(x)
- return error1(x, 0)
- end)
- exit_21_1 = (function(reason, code)
- local code1
- if string_3f_1(reason) then
- code1 = code
- else
- code1 = reason
- end
- if exit1 then
- if string_3f_1(reason) then
- print1(reason)
- end
- return exit1(code1)
- elseif string_3f_1(reason) then
- return fail_21_1(reason)
- else
- return fail_21_1()
- end
- end)
- const1 = (function(x)
- return (function(y)
- return x
- end)
- end)
- self1 = (function(x, key, ...)
- local args = _pack(...) args.tag = "list"
- return x[key](x, unpack1(args, 1, n1(args)))
- end)
- create1 = coroutine.create
- resume1 = coroutine.resume
- open1 = fs.open
- getName1 = fs.getName
- combine1 = fs.combine
- isReadOnly1 = fs.isReadOnly
- move1 = fs.move
- copy1 = fs.copy
- delete1 = fs.delete
- isDir1 = fs.isDir
- getFreeSpace1 = fs.getFreeSpace
- getSize1 = fs.getSize
- list2 = fs.list
- exists1 = fs.exists
- makeDir1 = fs.makeDir
- getDir1 = fs.getDir
- current1 = term.current
- day1 = os.day
- sleep1 = os.sleep
- setAlarm1 = os.setAlarm
- pullEventRaw1 = os.pullEventRaw
- clock1 = os.clock
- time1 = os.time
- cancelTimer1 = os.cancelTimer
- startTimer1 = os.startTimer
- cancelAlarm1 = os.cancelAlarm
- queueEvent1 = os.queueEvent
- resolve1 = shell.resolve
- log_21_1 = (function(message)
- return nil
- end)
- createVfs1 = (function(vfsMounts)
- local mounts = ({})
- local wrapFun = (function(_efunction)
- return (function(path, ...)
- local rest = _pack(...) rest.tag = "list"
- local mount, localPath = mountPath1(mounts, path)
- return mount[_efunction](localPath, unpack1(rest))
- end)
- end)
- local dirList = (function(x)
- local path = canonicalise1(x, true)
- local entries = wrapFun("list")(path)
- local temp = keys2(mounts)
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local mountPath = temp[temp2]
- local mountPathParts = split1(mountPath, "%/")
- if path == concat1(init1(mountPathParts), "/") and (mountPath ~= "" and _21_1(elem_3f_1(last1(mountPathParts), values1(entries)))) then
- entries[#entries + 1] = last1(mountPathParts)
- end
- temp2 = temp2 + 1
- end
- return entries
- end)
- local temp = n1(vfsMounts)
- local temp1 = 1
- while temp1 <= temp do
- local vfsMount = vfsMounts[temp1]
- local mountArgs = split1(vfsMount, "%:")
- local attributes, mountPoint, dir = split1(car2(mountArgs), ""), canonicalise1(cadr1(mountArgs), true), canonicalise1(caddr1(mountArgs), false)
- local fsType
- if elem_3f_1("r", attributes) then
- fsType = ({ tag="symbol", contents="realfs"})
- elseif elem_3f_1("t", attributes) then
- fsType = ({ tag="symbol", contents="tmpfs"})
- else
- fsType = error1("file system type not found.")
- end
- local readOnly = _21_1(elem_3f_1("w", attributes))
- if eq_3f_1(fsType, ({ tag="symbol", contents="realfs"})) then
- mounts[mountPoint] = createRealfs1(dir, readOnly)
- else
- error1("unimplemented.")
- end
- temp1 = temp1 + 1
- end
- return ({["list"]=dirList,["exists"]=wrapFun("exists"),["isDir"]=wrapFun("isDir"),["isReadOnly"]=wrapFun("isReadOnly"),["getName"]=getName1,["getDrive"]=(function(path)
- return "hdd"
- end),["getSize"]=wrapFun("getSize"),["getFreeSpace"]=wrapFun("getFreeSpace"),["makeDir"]=wrapFun("makeDir"),["move"]=(function(fromPath, toPath)
- if wrapFun("isReadOnly")(fromPath) or wrapFun("isReadOnly")(toPath) then
- return error1("permission denied.")
- else
- local mountFrom, localPathFrom = mountPath1(mounts, fromPath)
- local mountTo, localPathTo = mountPath1(mounts, toPath)
- if mountFrom ~= mountTo then
- return error1("copying across mounts is currently not implemented.")
- else
- return mountFrom["move"](localPathFrom, localPathTo)
- end
- end
- end),["copy"]=(function(fromPath, toPath)
- if wrapFun("isReadOnly")(toPath) then
- return error1("permission denied.")
- else
- local mountFrom, localPathFrom = mountPath1(mounts, fromPath)
- local mountTo, localPathTo = mountPath1(mounts, toPath)
- if mountFrom ~= mountTo then
- return error1("copying across mounts is currently not implemented.")
- else
- return mountFrom["copy"](localPathFrom, localPathTo)
- end
- end
- end),["delete"]=wrapFun("delete"),["combine"]=combine1,["open"]=wrapFun("open"),["find"]=(function(wildcard)
- if wrapFun("exists")(wildcard) then
- return list1(wildcard)
- else
- return ({tag = "list", n = 0})
- end
- end),["getDir"]=getDir1,["complete"]=(function(partialName, path, includeFiles, includeSlashes)
- if _21_1(wrapFun("isDir")()) then
- return ({})
- else
- local names = dirList(path)
- return filter1((function(x)
- return x == "nil"
- end), map2((function(name)
- if sub1(name, 1, n1(partialName)) == partialName then
- return name
- else
- return "nil"
- end
- end)))
- end
- end)})
- end)
- mountPath1 = (function(mounts, path)
- local absPath, mountName = canonicalise1(path, true), ""
- local temp = keys2(mounts)
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local mountPoint = temp[temp2]
- if n1(mountPoint) > n1(mountName) and sub1(absPath, 1, n1(mountPoint)) == mountPoint then
- mountName = mountPoint
- end
- temp2 = temp2 + 1
- end
- return unpack1(list1(mounts[mountName], canonicalise1(sub1(absPath, 1 + n1(mountName)), true)))
- end)
- canonicalise1 = (function(path, abs)
- local absPath = trim1((function()
- if abs then
- return path
- else
- return resolve1(path)
- end
- end)())
- local parts, i = split1(absPath, "%/"), 1
- while i <= n1(parts) do
- if nth1(parts, i) == ".." then
- removeNth_21_1(parts, i)
- if n1(parts) == 0 then
- error1("invalid path.")
- end
- i = pred1(i)
- removeNth_21_1(parts, i)
- else
- i = succ1(i)
- end
- end
- return concat1(filter1((function(x)
- return x ~= "" and x ~= "."
- end), parts), "/")
- end)
- createRealfs1 = (function(dir, readOnly)
- return ({["list"]=(function(path)
- return list2(display1(dir) .. "/" .. display1(path))
- end),["exists"]=(function(path)
- return exists1(display1(dir) .. "/" .. display1(path))
- end),["isDir"]=(function(path)
- return isDir1(display1(dir) .. "/" .. display1(path))
- end),["isReadOnly"]=(function(path)
- return readOnly or isReadOnly1(display1(dir) .. "/" .. display1(path))
- end),["getSize"]=(function(path)
- return getSize1(display1(dir) .. "/" .. display1(path))
- end),["getFreeSpace"]=(function(path)
- return getFreeSpace1(display1(dir) .. "/" .. display1(path))
- end),["makeDir"]=(function(path)
- if readOnly then
- return error1("permission denied.")
- else
- return makeDir1(display1(dir) .. "/" .. display1(path))
- end
- end),["delete"]=(function(path)
- if readOnly then
- return error1("permission denied.")
- else
- return delete1(display1(dir) .. "/" .. display1(path))
- end
- end),["move"]=(function(from, to)
- return move1(display1(dir) .. "/" .. display1(from), display1(dir) .. "/" .. display1(to))
- end),["copy"]=(function(from, to)
- return copy1(display1(dir) .. "/" .. display1(from), display1(dir) .. "/" .. display1(to))
- end),["open"]=(function(path, mode)
- return open1(display1(dir) .. "/" .. display1(path), mode)
- end)})
- end)
- create2 = (function(spec)
- local computer = ({["id"]=0,["label"]="computer-0",["running"]=true,["spec"]=spec,["vfs"]=createVfs1(spec["vfs-mounts"])})
- computer["env"] = (createEnv1(computer))
- createCoroutine_21_1(computer)
- return computer
- end)
- createCoroutine_21_1 = (function(computer)
- local bootCodeHandle = open1(resolve1(computer["spec"]["boot-file"]), "r")
- local bootCode
- if bootCodeHandle then
- bootCode = self1(bootCodeHandle, "readAll")
- else
- bootCode = error1("could not read boot file.")
- end
- local coroutine = create1(load1(bootCode, "ccjam-bios.lua", "t", computer["env"]))
- self1(bootCodeHandle, "close")
- computer["coroutine"] = coroutine
- if n1(computer["spec"]["startup-command"]) > 0 then
- next_21_1(computer, ({tag = "list", n = 2, "char", " "}))
- local temp = split1(computer["spec"]["startup-command"], "")
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- next_21_1(computer, list1("char", (temp[temp2])))
- temp2 = temp2 + 1
- end
- return next_21_1(computer, ({tag = "list", n = 2, "key", 28}))
- else
- return nil
- end
- end)
- eventWhitelist1 = ({tag = "list", n = 13, "timer", "alarm", "terminate", "http_success", "http_failure", "paste", "char", "key", "key_up", "mouse_click", "mouse_up", "mouse_scroll", "mouse_drag"})
- next_21_1 = (function(computer, args)
- local event = car2(args)
- if elem_3f_1(event, eventWhitelist1) then
- local result = list1(resume1(computer["coroutine"], event, unpack1(cdr2(args))))
- if car2(result) == false then
- return error1("computer panicked! error: \n" .. cadr1(result))
- else
- log_21_1("event: " .. pretty1(args))
- return unpack1(cdr2(result))
- end
- else
- return nil
- end
- end)
- envWhitelist1 = ({tag = "list", n = 33, "type", "setfenv", "string", "load", "loadstring", "pairs", "_VERSION", "ipairs", "rawequal", "xpcall", "_CC_DEFAULT_SETTINGS", "unpack", "bitop", "setmetatable", "rawset", "rawget", "table", "bit32", "_HOST", "bit", "assert", "error", "pcall", "tostring", "next", "tonumber", "math", "_RUNTIME", "coroutine", "biginteger", "getfenv", "select", "data"})
- createEnv1 = (function(computer)
- local spec, global, term, constFunStruct = computer["spec"], assoc_2d3e_struct1(map2((function(name)
- local contents = _G1[name]
- return list1(name, (function()
- if type1(contents) == "table" then
- return merge1(contents, ({}))
- else
- return contents
- end
- end)())
- end), envWhitelist1)), merge1(current1(), ({})), (function(xxs)
- return assoc_2d3e_struct1(flatMap1((function(xs)
- local value = const1(car2(xs))
- return map2((function(name)
- return list1(name, value)
- end), cdr2(xs))
- end), xxs))
- end)
- global["_G"] = global
- global["getmetatable"] = (function(a)
- if type_23_1(a) == "string" then
- return ({})
- else
- return getmetatable1(a)
- end
- end)
- global["term"] = term
- global["disk"] = (function()
- if spec["enable-disk"] then
- return _G1["disk"]
- else
- return constFunStruct(list1(list1(nil, "getMountPath", "setLabel", "getLabel", "getID", "getAudioTitle", "playAudio", "stopAudio", "eject"), list1(false, "isPresent", "hasData", "hasAudio")))
- end
- end)()
- global["peripheral"] = (function()
- if spec["enable-peripheral"] then
- return _G1["peripheral"]
- else
- return constFunStruct(list1(list1(nil, "getType", "getMethods", "call", "wrap", "find"), list1(false, "isPresent"), list1(({}), "getNames")))
- end
- end)()
- global["redstone"] = (function()
- if spec["enable-redstone"] then
- return _G1["redstone"]
- else
- return constFunStruct(list1(list1(nil, "setOutput", "setAnalogOutput", "setBundledOutput"), list1(false, "getInput", "testBundledInput"), list1(({}), "getSides"), list1(0, "getAnalogInput", "getAnalogOutput", "getBundledInput", "getBundledOutput")))
- end
- end)()
- global["os"] = ({["getComputerID"]=(function()
- return computer["id"]
- end),["getComputerLabel"]=(function()
- return computer["label"]
- end),["setComputerLabel"]=(function(label)
- computer["label"] = label
- return nil
- end),["queueEvent"]=queueEvent1,["clock"]=clock1,["startTimer"]=startTimer1,["cancelTimer"]=cancelTimer1,["time"]=time1,["day"]=day1,["setAlarm"]=setAlarm1,["cancelAlarm"]=cancelAlarm1,["shutdown"]=(function()
- computer["running"] = false
- return nil
- end),["reboot"]=(function()
- createCoroutine_21_1(computer)
- return sleep1(0)
- end)})
- global["rs"] = global["redstone"]
- if _21_1(computer["spec"]["disable-networking"]) then
- global["http"] = (function()
- if _G1["http"] then
- return merge1(_G1["http"], ({}))
- else
- return nil
- end
- end)()
- global["socket"] = (function()
- if _G1["socket"] then
- return merge1(_G1["socket"], ({}))
- else
- return nil
- end
- end)()
- end
- global["fs"] = computer["vfs"]
- return global
- end)
- config1 = package.config
- coloredAnsi1 = (function(col, msg)
- return "\27[" .. col .. "m" .. msg .. "\27[0m"
- end)
- local termTy = lower1(getenv1 and getenv1("TERM") or "")
- if termTy == "dumb" then
- colored_3f_1 = false
- elseif find1(termTy, "xterm") then
- colored_3f_1 = true
- elseif config1 and charAt1(config1, 1) == "/" then
- colored_3f_1 = true
- elseif getenv1 and getenv1("ANSICON") ~= nil then
- colored_3f_1 = true
- else
- colored_3f_1 = false
- end
- if colored_3f_1 then
- colored1 = coloredAnsi1
- else
- colored1 = (function(col, msg)
- return msg
- end)
- end
- create3 = (function(description)
- return ({["desc"]=description,["flag-map"]=({}),["opt-map"]=({}),["cats"]=({tag = "list", n = 0}),["opt"]=({tag = "list", n = 0}),["pos"]=({tag = "list", n = 0})})
- end)
- setAction1 = (function(arg, data, value)
- data[arg["name"]] = value
- return nil
- end)
- addAction1 = (function(arg, data, value)
- local lst = data[arg["name"]]
- if not lst then
- lst = ({tag = "list", n = 0})
- data[arg["name"]] = lst
- end
- return pushCdr_21_1(lst, value)
- end)
- addArgument_21_1 = (function(spec, names, ...)
- local options = _pack(...) options.tag = "list"
- local temp = type1(names)
- if temp ~= "list" then
- error1(format1("bad argument %s (expected %s, got %s)", "names", "list", temp), 2)
- end
- if empty_3f_1(names) then
- error1("Names list is empty")
- end
- if not (n1(options) % 2 == 0) then
- error1("Options list should be a multiple of two")
- end
- local result = ({["names"]=names,["action"]=nil,["narg"]=0,["default"]=false,["help"]="",["value"]=true})
- local first = car2(names)
- if sub1(first, 1, 2) == "--" then
- pushCdr_21_1(spec["opt"], result)
- result["name"] = sub1(first, 3)
- elseif sub1(first, 1, 1) == "-" then
- pushCdr_21_1(spec["opt"], result)
- result["name"] = sub1(first, 2)
- else
- result["name"] = first
- result["narg"] = "*"
- result["default"] = ({tag = "list", n = 0})
- pushCdr_21_1(spec["pos"], result)
- end
- local temp = n1(names)
- local temp1 = 1
- while temp1 <= temp do
- local name = names[temp1]
- if sub1(name, 1, 2) == "--" then
- spec["opt-map"][sub1(name, 3)] = result
- elseif sub1(name, 1, 1) == "-" then
- spec["flag-map"][sub1(name, 2)] = result
- end
- temp1 = temp1 + 1
- end
- local temp = n1(options)
- local temp1 = 1
- while temp1 <= temp do
- result[nth1(options, temp1)] = (nth1(options, temp1 + 1))
- temp1 = temp1 + 2
- end
- if not result["var"] then
- result["var"] = upper1(result["name"])
- end
- if not result["action"] then
- result["action"] = (function()
- local temp
- if number_3f_1(result["narg"]) then
- temp = result["narg"] <= 1
- else
- temp = result["narg"] == "?"
- end
- if temp then
- return setAction1
- else
- return addAction1
- end
- end)()
- end
- return result
- end)
- addHelp_21_1 = (function(spec)
- return addArgument_21_1(spec, ({tag = "list", n = 2, "--help", "-h"}), "help", "Show this help message", "default", nil, "value", nil, "action", (function(arg, result, value)
- help_21_1(spec)
- return exit_21_1(0)
- end))
- end)
- usageNarg_21_1 = (function(buffer, arg)
- local temp = arg["narg"]
- if temp == "?" then
- return pushCdr_21_1(buffer, " [" .. arg["var"] .. "]")
- elseif temp == "*" then
- return pushCdr_21_1(buffer, " [" .. arg["var"] .. "...]")
- elseif temp == "+" then
- return pushCdr_21_1(buffer, " " .. arg["var"] .. " [" .. arg["var"] .. "...]")
- else
- local temp1 = 1
- while temp1 <= temp do
- pushCdr_21_1(buffer, " " .. arg["var"])
- temp1 = temp1 + 1
- end
- return nil
- end
- end)
- usage_21_1 = (function(spec, name)
- if not name then
- name = nth1(arg1, 0) or (arg1[-1] or "?")
- end
- local usage = list1("usage: ", name)
- local temp = spec["opt"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local arg = temp[temp2]
- pushCdr_21_1(usage, " [" .. car2(arg["names"]))
- usageNarg_21_1(usage, arg)
- pushCdr_21_1(usage, "]")
- temp2 = temp2 + 1
- end
- local temp = spec["pos"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- usageNarg_21_1(usage, (temp[temp2]))
- temp2 = temp2 + 1
- end
- return print1(concat1(usage))
- end)
- usageError_21_1 = (function(spec, name, error)
- usage_21_1(spec, name)
- print1(error)
- return exit_21_1(1)
- end)
- helpArgs_21_1 = (function(pos, opt, format)
- if (empty_3f_1(pos) and empty_3f_1(opt)) then
- return nil
- else
- print1()
- local temp = n1(pos)
- local temp1 = 1
- while temp1 <= temp do
- local arg = pos[temp1]
- print1(format1(format, arg["var"], arg["help"]))
- temp1 = temp1 + 1
- end
- local temp = n1(opt)
- local temp1 = 1
- while temp1 <= temp do
- local arg = opt[temp1]
- print1(format1(format, concat1(arg["names"], ", "), arg["help"]))
- temp1 = temp1 + 1
- end
- return nil
- end
- end)
- help_21_1 = (function(spec, name)
- if not name then
- name = nth1(arg1, 0) or (arg1[-1] or "?")
- end
- usage_21_1(spec, name)
- if spec["desc"] then
- print1()
- print1(spec["desc"])
- end
- local max = 0
- local temp = spec["pos"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local arg = temp[temp2]
- local len = n1(arg["var"])
- if len > max then
- max = len
- end
- temp2 = temp2 + 1
- end
- local temp = spec["opt"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local arg = temp[temp2]
- local len = n1(concat1(arg["names"], ", "))
- if len > max then
- max = len
- end
- temp2 = temp2 + 1
- end
- local fmt = " %-" .. tostring1(max + 1) .. "s %s"
- helpArgs_21_1(filter1((function(x)
- return x["cat"] == nil
- end), spec["pos"]), filter1((function(x)
- return x["cat"] == nil
- end), spec["opt"]), fmt)
- local temp = spec["cats"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local cat = temp[temp2]
- print1()
- print1(colored1("4", cat["name"]))
- local desc = cat["desc"]
- if desc then
- print1(desc)
- end
- helpArgs_21_1(filter1((function(x)
- return x["cat"] == cat["id"]
- end), spec["pos"]), filter1((function(x)
- return x["cat"] == cat["id"]
- end), spec["opt"]), fmt)
- temp2 = temp2 + 1
- end
- return nil
- end)
- matcher1 = (function(pattern)
- return (function(x)
- local res = list1(match1(x, pattern))
- if car2(res) == nil then
- return nil
- else
- return res
- end
- end)
- end)
- parse_21_1 = (function(spec, args)
- if not args then
- args = arg1
- end
- local result, pos, idx, len, usage_21_ = ({}), spec["pos"], 1, n1(args), (function(msg)
- return usageError_21_1(spec, nth1(args, 0), msg)
- end)
- local action = (function(arg, value)
- return arg["action"](arg, result, value, usage_21_)
- end)
- local readArgs = (function(key, arg)
- local temp = arg["narg"]
- if temp == "+" then
- idx = succ1(idx)
- local elem = nth1(args, idx)
- if elem == nil then
- usage_21_("Expected " .. arg["var"] .. " after --" .. key .. ", got nothing")
- elseif _21_1(arg["all"]) and find1(elem, "^%-") then
- usage_21_("Expected " .. arg["var"] .. " after --" .. key .. ", got " .. nth1(args, idx))
- else
- action(arg, elem)
- end
- local running = true
- while running do
- idx = succ1(idx)
- local elem = nth1(args, idx)
- if elem == nil then
- running = false
- elseif _21_1(arg["all"]) and find1(elem, "^%-") then
- running = false
- else
- action(arg, elem)
- end
- end
- return nil
- elseif temp == "*" then
- local running = true
- while running do
- idx = succ1(idx)
- local elem = nth1(args, idx)
- if elem == nil then
- running = false
- elseif _21_1(arg["all"]) and find1(elem, "^%-") then
- running = false
- else
- action(arg, elem)
- end
- end
- return nil
- elseif temp == "?" then
- idx = succ1(idx)
- local elem = nth1(args, idx)
- if elem == nil or _21_1(arg["all"]) and find1(elem, "^%-") then
- return arg["action"](arg, result, arg["value"])
- else
- idx = succ1(idx)
- return action(arg, elem)
- end
- elseif temp == 0 then
- idx = succ1(idx)
- return action(arg, arg["value"])
- else
- local temp1 = 1
- while temp1 <= temp do
- idx = succ1(idx)
- local elem = nth1(args, idx)
- if elem == nil then
- usage_21_("Expected " .. temp .. " args for " .. key .. ", got " .. pred1(temp1))
- elseif _21_1(arg["all"]) and find1(elem, "^%-") then
- usage_21_("Expected " .. temp .. " for " .. key .. ", got " .. pred1(temp1))
- else
- action(arg, elem)
- end
- temp1 = temp1 + 1
- end
- idx = succ1(idx)
- return nil
- end
- end)
- while idx <= len do
- local temp = nth1(args, idx)
- local temp1
- local temp2 = matcher1("^%-%-([^=]+)=(.+)$")(temp)
- temp1 = list_3f_1(temp2) and (n1(temp2) >= 2 and (n1(temp2) <= 2 and true))
- if temp1 then
- local key, val = nth1(matcher1("^%-%-([^=]+)=(.+)$")(temp), 1), nth1(matcher1("^%-%-([^=]+)=(.+)$")(temp), 2)
- local arg = spec["opt-map"][key]
- if arg == nil then
- usage_21_("Unknown argument " .. key .. " in " .. nth1(args, idx))
- elseif _21_1(arg["many"]) and nil ~= result[arg["name"]] then
- usage_21_("Too may values for " .. key .. " in " .. nth1(args, idx))
- else
- local narg = arg["narg"]
- if number_3f_1(narg) and narg ~= 1 then
- usage_21_("Expected " .. tostring1(narg) .. " values, got 1 in " .. nth1(args, idx))
- end
- action(arg, val)
- end
- idx = succ1(idx)
- else
- local temp1
- local temp2 = matcher1("^%-%-(.*)$")(temp)
- temp1 = list_3f_1(temp2) and (n1(temp2) >= 1 and (n1(temp2) <= 1 and true))
- if temp1 then
- local key = nth1(matcher1("^%-%-(.*)$")(temp), 1)
- local arg = spec["opt-map"][key]
- if arg == nil then
- usage_21_("Unknown argument " .. key .. " in " .. nth1(args, idx))
- elseif _21_1(arg["many"]) and nil ~= result[arg["name"]] then
- usage_21_("Too may values for " .. key .. " in " .. nth1(args, idx))
- else
- readArgs(key, arg)
- end
- else
- local temp1
- local temp2 = matcher1("^%-(.+)$")(temp)
- temp1 = list_3f_1(temp2) and (n1(temp2) >= 1 and (n1(temp2) <= 1 and true))
- if temp1 then
- local flags, i = nth1(matcher1("^%-(.+)$")(temp), 1), 1
- local s = n1(flags)
- while i <= s do
- local key = charAt1(flags, i)
- local arg = spec["flag-map"][key]
- if arg == nil then
- usage_21_("Unknown flag " .. key .. " in " .. nth1(args, idx))
- elseif _21_1(arg["many"]) and nil ~= result[arg["name"]] then
- usage_21_("Too many occurances of " .. key .. " in " .. nth1(args, idx))
- else
- local narg = arg["narg"]
- if i == s then
- readArgs(key, arg)
- elseif narg == 0 then
- action(arg, arg["value"])
- else
- action(arg, sub1(flags, succ1(i)))
- i = succ1(s)
- idx = succ1(idx)
- end
- end
- i = succ1(i)
- end
- else
- local arg = car2(spec["pos"])
- if arg then
- action(arg, temp)
- else
- usage_21_("Unknown argument " .. arg)
- end
- idx = succ1(idx)
- end
- end
- end
- end
- local temp = spec["opt"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local arg = temp[temp2]
- if result[arg["name"]] == nil then
- result[arg["name"]] = arg["default"]
- end
- temp2 = temp2 + 1
- end
- local temp = spec["pos"]
- local temp1 = n1(temp)
- local temp2 = 1
- while temp2 <= temp1 do
- local arg = temp[temp2]
- if result[arg["name"]] == nil then
- result[arg["name"]] = arg["default"]
- end
- temp2 = temp2 + 1
- end
- return result
- end)
- local spec = create3()
- addHelp_21_1(spec)
- addArgument_21_1(spec, ({tag = "list", n = 1, "vfs-mounts"}), "help", "The virtual file system mounts.\n `<attrs>:<mount>:[dir]`\n attr: attributes. w (write), t (tempfs), r (realfs)\n Temp doesn't require a dir argument.\n mount: mount point (has to start with /)\n dir: host file system directory\n Can be relative to the current directory.\n Default: rw:/:. r:/rom:/rom", "default", ({tag = "list", n = 2, "rw:/:.", "r:/rom:/rom"}))
- addArgument_21_1(spec, ({tag = "list", n = 2, "--boot", "-b"}), "name", "boot-file", "help", " The boot file. Default: ./bios.lua", "default", "bios.lua", "narg", 1)
- addArgument_21_1(spec, ({tag = "list", n = 2, "--command", "-c"}), "name", "startup-command", "help", " The startup command.", "default", "", "narg", 1)
- addArgument_21_1(spec, ({tag = "list", n = 2, "--disable-net", "-n"}), "name", "disable-networking", "help", " Disables networking (http, socket).")
- addArgument_21_1(spec, ({tag = "list", n = 2, "--enable-rs", "-R"}), "name", "enable-redstone", "help", " Enables redstone passthrough.")
- addArgument_21_1(spec, ({tag = "list", n = 2, "--enable-per", "-P"}), "name", "enable-peripheral", "help", " Enables peripheral passthrough.")
- addArgument_21_1(spec, ({tag = "list", n = 2, "--enable-disk", "-D"}), "name", "enable-disk", "help", " Enables disk drive passthrough.")
- args1 = parse_21_1(spec)
- run1 = (function()
- local comp = create2(args1)
- while comp["running"] do
- next_21_1(comp, list1(pullEventRaw1()))
- end
- return nil
- end)
- return run1()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement