Update readline implementation based on example