But my suggestion is, to make a minor edit to the shell program so that program.lua can be ran by simply typing "program".
This would encourage the usage of the .lua extension, so that people with a syntax highlighting text editor can edit the lua files on their PC without having to manually set the filetype everytime.
This can be changed in ComputerCraft/lua/rom/programs/shell
from
local function run( _sCommand, ... )
local sPath = shell.resolveProgram( _sCommand )
if sPath ~= nil then
tProgramStack[#tProgramStack + 1] = sPath
local result = os.run( tEnv, sPath, ... )
tProgramStack[#tProgramStack] = nil
return result
else
printError( "No such program" )
return false
end
end
to
local function run( _sCommand, ... )
local sPath = shell.resolveProgram( _sCommand )
local sPath2 = shell.resolveProgram( _sCommand..'.lua' )
if sPath ~= nil then
tProgramStack[#tProgramStack + 1] = sPath
local result = os.run( tEnv, sPath, ... )
tProgramStack[#tProgramStack] = nil
return result
elseif sPath2 ~= nil then
tProgramStack[#tProgramStack + 1] = sPath2
local result = os.run( tEnv, sPath2, ... )
tProgramStack[#tProgramStack] = nil
return result
else
printError( "No such program: " .. _sCommand )
return false
end
end
I know it's not necessary, but as I said, it'd make people able to use the .lua extension without having to make the user type more, and code editors would better understand these, and maybe Windows can understand what these files are and not "File"…
And of course it still runs the non-.lua programs with highest priority, so it shouldn't break anything.