1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-15 07:13:13 +00:00

Merge pull request #309 from Wilma456/execcom

Add autocompletion to exec
This commit is contained in:
Daniel Ratcliffe 2017-06-19 20:44:21 +01:00 committed by GitHub
commit 174b63d59a

View File

@ -168,6 +168,15 @@ local function completeSet( shell, nIndex, sText, tPreviousText )
return completeMultipleChoice( sText, settings.getNames(), true )
end
end
local tCommands
if commands then
tCommands = commands.list()
end
local function completeExec( shell, nIndex, sText, tPreviousText )
if nIndex == 1 and commands then
return completeMultipleChoice( sText, tCommands, true )
end
end
shell.setCompletionFunction( "rom/programs/alias.lua", completeAlias )
shell.setCompletionFunction( "rom/programs/cd.lua", completeDir )
shell.setCompletionFunction( "rom/programs/copy.lua", completeEitherEither )
@ -194,6 +203,7 @@ shell.setCompletionFunction( "rom/programs/fun/dj.lua", completeDJ )
shell.setCompletionFunction( "rom/programs/fun/advanced/paint.lua", completeFile )
shell.setCompletionFunction( "rom/programs/http/pastebin.lua", completePastebin )
shell.setCompletionFunction( "rom/programs/rednet/chat.lua", completeChat )
shell.setCompletionFunction( "rom/programs/command/exec.lua", completeExec )
-- Run autorun files
if fs.exists( "/rom/autorun" ) and fs.isDir( "/rom/autorun" ) then