cli: handle newlines better