Added implementation of the AUTO mode in readLine