cli: function getline improved