Advertisement
ecoMeco

Cat

Dec 22nd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. tArgs = { ... }
  2.  
  3. if #tArgs == 1 then
  4.     if fs.exists(tArgs[1]) then
  5.         file = fs.open(tArgs[1], "r")
  6.         for line in io.lines(tArgs[1]) do
  7.             script = file.readLine()
  8.             if script ~= nil then
  9.                 print(line)
  10.             else
  11.                 break
  12.             end    
  13.         end
  14.         file.close()
  15.     else
  16.         error("Can't find file " .. tArgs[1])
  17.     end
  18. elseif #tArgs >= 1 then
  19.     error("More than one file is NYI")
  20. elseif #tArgs <= 1 then
  21.     print("Usage: ")
  22.     print(shell.getRunningProgram() .. " <file>")
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement