mirror of
https://github.com/kepler155c/opus
synced 2025-11-15 06:47:12 +00:00
spaces->tabs + cleanup + pathing fixes
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
local function completeMultipleChoice(sText, tOptions, bAddSpaces)
|
||||
local tResults = { }
|
||||
for n = 1,#tOptions do
|
||||
local sOption = tOptions[n]
|
||||
if #sOption + (bAddSpaces and 1 or 0) > #sText and string.sub(sOption, 1, #sText) == sText then
|
||||
local sResult = string.sub(sOption, #sText + 1)
|
||||
if bAddSpaces then
|
||||
table.insert(tResults, sResult .. " ")
|
||||
else
|
||||
table.insert(tResults, sResult)
|
||||
end
|
||||
end
|
||||
end
|
||||
return tResults
|
||||
local tResults = { }
|
||||
for n = 1,#tOptions do
|
||||
local sOption = tOptions[n]
|
||||
if #sOption + (bAddSpaces and 1 or 0) > #sText and string.sub(sOption, 1, #sText) == sText then
|
||||
local sResult = string.sub(sOption, #sText + 1)
|
||||
if bAddSpaces then
|
||||
table.insert(tResults, sResult .. " ")
|
||||
else
|
||||
table.insert(tResults, sResult)
|
||||
end
|
||||
end
|
||||
end
|
||||
return tResults
|
||||
end
|
||||
|
||||
_ENV.shell.setCompletionFunction("sys/apps/package.lua",
|
||||
function(_, index, text)
|
||||
if index == 1 then
|
||||
return completeMultipleChoice(text, { "install ", "update ", "uninstall " })
|
||||
end
|
||||
end)
|
||||
function(_, index, text)
|
||||
if index == 1 then
|
||||
return completeMultipleChoice(text, { "install ", "update ", "uninstall " })
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user