1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-02 16:43:01 +00:00

clipping for transistions + tab ordering via index + more examples

This commit is contained in:
kepler155c@gmail.com
2019-11-15 12:51:44 -07:00
parent 14057c2bf9
commit efa1a5bbf5
11 changed files with 138 additions and 57 deletions

View File

@@ -1,3 +1,5 @@
local fs = _G.fs
local function completeMultipleChoice(sText, tOptions, bAddSpaces)
local tResults = { }
for n = 1,#tOptions do
@@ -20,3 +22,14 @@ _ENV.shell.setCompletionFunction("sys/apps/package.lua",
return completeMultipleChoice(text, { "install ", "update ", "uninstall ", "updateall ", "refresh" })
end
end)
_ENV.shell.setCompletionFunction("sys/apps/inspect.lua",
function(_, index, text)
if index == 1 then
local components = { }
for _, f in pairs(fs.list('sys/modules/opus/ui/components')) do
table.insert(components, (f:gsub("%.lua$", "")))
end
return completeMultipleChoice(text, components)
end
end)