v0.8.0 - Added help and fetch.

This commit is contained in:
TheWahlolly
2025-04-27 18:25:12 +03:00
parent 109c0beffb
commit 614c9011cf
20 changed files with 214 additions and 18 deletions
+26
View File
@@ -0,0 +1,26 @@
local fs = import("filesystem")
local args = {...}
local command = args[1]
args = nil
if not command then
local handle, data, tmpdata = fs.open("/halyde/apps/helpdb/default.txt", "r"), "", nil
repeat
tmpdata = handle:read(math.huge or math.maxinteger)
data = data .. (tmpdata or "")
until not tmpdata
print(data)
return
end
if shell.aliases[command] then
command = shell.aliases[command]
end
if fs.exists("/halyde/apps/helpdb/" .. command .. ".txt") then
local handle, data, tmpdata = fs.open("/halyde/apps/helpdb/" .. command .. ".txt", "r"), "", nil
repeat
tmpdata = handle:read(math.huge or math.maxinteger)
data = data .. (tmpdata or "")
until not tmpdata
print(data)
else
print("Could not find help file for: " .. command .. ".")
end