improvement: separate the looping of user input out of the list and move it to the IOHelper

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
add rdocs to iohelper

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
return the selected item from the list

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
print the selected index of the list in the example

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>