added --line-buffered option