Upload files to "git/filePrinter"

This commit is contained in:
2025-11-09 17:48:10 -05:00
parent 82ba0fde66
commit 9d3e06ac9f
2 changed files with 55 additions and 0 deletions

View 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

View File

@@ -0,0 +1,2 @@
url="https://git.astronand.dev/minecartchris/Lua---CC-bs/raw/branch/main/git/filePrinter/"
files=["project.file", "program.lua"]