Upload files to "git/filePrinter"
This commit is contained in:
53
git/filePrinter/program.lua
Normal file
53
git/filePrinter/program.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
--local tArgs = { ... }
|
||||
--if #tArgs == 0 then
|
||||
-- local programName = arg[0] or fs.getName(shell.getRunningProgram())
|
||||
-- print("Usage: " .. programName .. " options <path>")
|
||||
-- return
|
||||
--end
|
||||
|
||||
-- Error checking
|
||||
--local sPath = shell.resolve(tArgs[2])
|
||||
--local bReadOnly = fs.isReadOnly(sPath)
|
||||
--if fs.exists(sPath) and fs.isDir(sPath) then
|
||||
-- print("Cannot edit a directory.")
|
||||
-- return
|
||||
--end
|
||||
|
||||
--local lex_context = { line = function() end, report = function() end }
|
||||
|
||||
--local tCompletions
|
||||
--local nCompletion
|
||||
|
||||
--local tCompleteEnv = _ENV
|
||||
--local function complete(sLine)
|
||||
-- if settings.get("edit.autocomplete") then
|
||||
-- local nStartPos = string.find(sLine, "[a-zA-Z0-9_%.:]+$")
|
||||
-- if nStartPos then
|
||||
-- sLine = string.sub(sLine, nStartPos)
|
||||
-- end
|
||||
-- if #sLine > 0 then
|
||||
-- return textutils.complete(sLine, tCompleteEnv)
|
||||
-- end
|
||||
-- end
|
||||
-- return nil
|
||||
--end
|
||||
|
||||
local args = { ... }
|
||||
|
||||
local function printHelp()
|
||||
print("options discription")
|
||||
print("-m program")
|
||||
print("--help or -h help")
|
||||
end
|
||||
|
||||
if args == "--help" or args == "-h" then
|
||||
printHelp()
|
||||
elseif args == "-m" then
|
||||
local fileName = tArgs[2]
|
||||
local file = fs.open(fileName, "r")
|
||||
local data = file.readAll()
|
||||
file.close()
|
||||
print(data.."\n [End Of File]")
|
||||
else
|
||||
printHelp()
|
||||
end
|
||||
2
git/filePrinter/project.file
Normal file
2
git/filePrinter/project.file
Normal file
@@ -0,0 +1,2 @@
|
||||
url="https://git.astronand.dev/minecartchris/Lua---CC-bs/raw/branch/main/git/filePrinter/"
|
||||
files=["project.file", "program.lua"]
|
||||
Reference in New Issue
Block a user