tArgs = { ... }
if #tArgs > 0 then
	sTopic = tArgs[1]
else
	sTopic = "intro"
end

if sTopic == "index" then
	print( "Help topics availiable:" )
	shell.run( "ls", "/rom/help" )
	return
end
	
local w,h = term.getSize()
local file = io.open( "rom/help/"..sTopic )
local nLinesPrinted = 0
if file then
	local sLine = file:read()
	local nLines = 0
	while sLine do
    	nLinesPrinted = nLinesPrinted + print( sLine )
    	sLine = file:read()
    	if sLine and nLinesPrinted >= h - 2 then
    		term.write( "Press any key to continue" )
    		repeat
    			local event = os.pullEvent()
    		until event == "key"
    		term.clearLine()
    		term.setCursorPos(1,h)
    	end
    end
	file:close()
else
	print( "No help available" )
end
