print("Will attempt to show info about peripherals...")

tw, th = term.getSize()

function pick_from_table(t)
    for k,v in pairs(t) do
        print(tostring(k)..': '..tostring(v))
    end
    print('Pick an option: ')
    local input = read()
    if tonumber(input) ~= nil then
        return t[tonumber(input)]
    else
        return t[input]
    end
end

function print_table(t)
    n = 1
    for k,v in pairs(t) do
        print(tostring(k)..': '..tostring(v))
        n = n + 1
        if n > th - 2 then
          print('press enter to continue,,,')
          read()
          n = 1
        end
    end    
end

psides = peripheral.getNames()
side = pick_from_table(psides)

term.clear()
term.setCursorPos(1,1)
print(peripheral.getType(side))
mt = peripheral.getMethods(side)
print_table(mt)
