Changeset View
Changeset View
Standalone View
Standalone View
stand/lua/cli.lua
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | cli["show-module-options"] = function() | ||||
pager.open() | pager.open() | ||||
for _, v in ipairs(lines) do | for _, v in ipairs(lines) do | ||||
pager.output(v .. "\n") | pager.output(v .. "\n") | ||||
end | end | ||||
pager.close() | pager.close() | ||||
end | end | ||||
cli["disable-device"] = function(...) | |||||
local _, argv = cli.arguments(...) | |||||
local d, u | |||||
if #argv == 0 then | |||||
print("usage error: disable-device device") | |||||
tsoome: is it worth it to list disabled devices here? | |||||
Done Inline ActionsI don't think there's enough demand for that...and I'm not sure the proper interface for it anyway.... imp: I don't think there's enough demand for that...and I'm not sure the proper interface for it… | |||||
return | |||||
end | |||||
d, u = string.match(argv[1], "(%w*%a)(%d+)") | |||||
if d ~= nil then | |||||
loader.setenv("hint." .. d .. "." .. u .. ".disabled", "1") | |||||
end | |||||
end | |||||
-- Used for splitting cli varargs into cmd_name and the rest of argv | -- Used for splitting cli varargs into cmd_name and the rest of argv | ||||
function cli.arguments(...) | function cli.arguments(...) | ||||
local argv = {...} | local argv = {...} | ||||
local cmd_name | local cmd_name | ||||
cmd_name, argv = core.popFrontTable(argv) | cmd_name, argv = core.popFrontTable(argv) | ||||
return cmd_name, argv | return cmd_name, argv | ||||
end | end | ||||
return cli | return cli |
is it worth it to list disabled devices here?