@@ -59,21 +59,21 @@ local function label(parts)
5959end
6060
6161local function outputFile (file , paged )
62- local handle , reason = filesystem .open (file )
63- if not handle then
64- error (reason , 2 )
65- end
66- local buffer = " "
67- repeat
68- local data , reason = filesystem .read (handle )
69- if not data and reason then
70- error (reason )
71- end
72- buffer = buffer .. (data or " " )
73- until not data
74- filesystem .close (handle )
75- if paged then printPaged (buffer )
76- else print (buffer ) end
62+ local handle , reason = filesystem .open (file )
63+ if not handle then
64+ error (reason , 2 )
65+ end
66+ local buffer = " "
67+ repeat
68+ local data , reason = filesystem .read (handle )
69+ if not data and reason then
70+ error (reason )
71+ end
72+ buffer = buffer .. (data or " " )
73+ until not data
74+ filesystem .close (handle )
75+ if paged then printPaged (buffer )
76+ else print (buffer ) end
7777end
7878
7979local function dir (folder )
@@ -95,9 +95,9 @@ local function moveFile(from, to, force)
9595 checkArg (1 , from , " string" )
9696 checkArg (2 , to , " string" )
9797 if fs .isDirectory (to ) then
98- if not fs .name then error (" Need to specify name for destination!" , 0 ) end
98+ if not fs .name then error (" Need to specify name for destination!" , 0 ) end
9999 to = to .. " /" .. fs .name (from )
100- end
100+ end
101101 if fs .exists (to ) then
102102 if not force then
103103 printErr (" target file exists" )
@@ -115,9 +115,9 @@ local function copyFile(from, to, force)
115115 checkArg (1 , from , " string" )
116116 checkArg (2 , to , " string" )
117117 if fs .isDirectory (to ) then
118- if not fs .name then error (" Need to specify name for destination!" , 0 ) end
118+ if not fs .name then error (" Need to specify name for destination!" , 0 ) end
119119 to = to .. " /" .. fs .name (from )
120- end
120+ end
121121 if fs .exists (to ) then
122122 if not force then
123123 printErr (" target file exists" )
@@ -163,7 +163,7 @@ local function runline(line)
163163 runprog (command , parts ) return true
164164 end
165165 end
166- if filesystem .exists (command .. " .lua" ) then
166+ if filesystem .exists (command .. " .lua" ) then
167167 if not filesystem .isDirectory (command .. " .lua" ) then
168168 runprog (command .. " .lua" , parts )
169169 return true
@@ -177,7 +177,7 @@ local function runline(line)
177177 end
178178 -- internal commands
179179 if command == " exit" then history = {} return " exit" end
180- if command == " cls" then term .clear () return true end
180+ if command == " cls" then term .clear (); term . gpu (). setForeground ( 0xFFFFFF ); term . gpu (). setBackground ( 0x000000 ) return true end
181181 if command == " ver" then print (_OSVERSION ) return true end
182182 if command == " mem" then print (math.floor (computer .totalMemory ()/ 1024 ).. " k RAM, " .. math.floor (computer .freeMemory ()/ 1024 ).. " k Free" ) return true end
183183 if command == " dir" then if parts [2 ] then dir (fixPath (parts [2 ])) else dir () end return true end
0 commit comments